| Crates.io | zakat-core |
| lib.rs | zakat-core |
| version | 1.4.0 |
| created_at | 2026-01-03 04:14:49.437988+00 |
| updated_at | 2026-01-05 15:00:06.887523+00 |
| description | Core mathematical logic, data structures, Fiqh rules, and input validation for Zakat calculations. |
| homepage | |
| repository | https://github.com/IRedDragonICY/zakatrs |
| max_upload_size | |
| id | 2019581 |
| size | 488,284 |
Core mathematical logic, data structures, Fiqh rules, and input validation for Zakat calculations.
zakat-core provides the foundational building blocks for Zakat calculation:
rust_decimal| Module | Description |
|---|---|
maal::precious_metals |
Gold and Silver with purity and weight calculations |
maal::business |
Trade goods, inventory, receivables, and liabilities |
maal::agriculture |
Crops with irrigation method differentiation |
maal::livestock |
Camels, cattle, and sheep with Nisab tables |
maal::income |
Professional income (gross/net methods) |
maal::investments |
Stocks, bonds, and cryptocurrency |
maal::mining |
Minerals and buried treasure (Rikaz) |
use zakat_core::prelude::*;
use zakat_core::maal::precious_metals::PreciousMetals;
use zakat_core::config::ZakatConfig;
let config = ZakatConfig::default();
let gold = PreciousMetals::gold(100.0)
.purity(24)
.calculate_zakat(&config)?;
println!("Zakat due: {}", gold.zakat_due);
The crate handles international number formats automatically:
use zakat_core::inputs::IntoZakatDecimal;
// US format
let amount: Decimal = "$1,234.56".into_zakat_decimal()?;
// European format
let amount: Decimal = "1.234,56".into_zakat_decimal()?;
// Arabic numerals
let amount: Decimal = "١٢٣٤.٥٦".into_zakat_decimal()?;
| Feature | Description |
|---|---|
async |
Async calculation support with Tokio |
wasm |
WebAssembly bindings |
python |
Python bindings via PyO3 |
uniffi |
Kotlin/Swift bindings via UniFFI |
MIT