Islamic fasting rules engine - determine Wajib, Sunnah, Makruh, Haram status for any date
Project description
Shaum
A production-grade Rust library for Islamic fasting (Shaum) jurisprudence with high-precision astronomical calculations for Hilal visibility.
Features
Fiqh Engine
- Hijri Conversion: Umm al-Qura algorithm with moon-sighting adjustment support.
- Rule Priority: Haram > Wajib > Sunnah > Makruh > Mubah.
- Status Classification:
- Wajib: Ramadan
- Haram: Eid al-Fitr, Eid al-Adha, Days of Tashriq
- Sunnah: Arafah, Ashura, Tasu'a, Ayyamul Bidh, Mondays, Thursdays, Shawwal
- Makruh: Singling out Friday or Saturday
Astronomy Engine
Native high-precision ephemeris calculations for Hilal visibility determination:
- Sun Position: VSOP87 theory (~1 arcsec precision)
- Moon Position: ELP2000-82 theory (~1 arcsec precision)
- Coordinate Systems: Ecliptic, Equatorial, Horizontal
- Corrections: Topocentric parallax, atmospheric refraction (Bennett)
- Visibility: MABIMS criteria (altitude ≥ 3°, elongation ≥ 6.4°)
Validated against 87 years of historical Indonesian Ramadan dates (1938-2024).
Installation
Rust
[dependencies]
shaum = "0.8"
JavaScript/TypeScript (NPM)
npm install shaum-wasm
Deno (JSR)
import { analyze } from "jsr:@islam/shaum";
Usage
Rust
use shaum::prelude::*;
use chrono::NaiveDate;
let date = NaiveDate::from_ymd_opt(2025, 6, 5).unwrap();
let analysis = shaum::analyze_date(date)?;
println!("Status: {:?}", analysis.primary_status);
JavaScript
import init, { analyze } from 'shaum-wasm';
await init();
const result = analyze("2025-06-05");
console.log(result.primaryStatus);
Workspace Structure
shaum/
├── crates/
│ ├── shaum-types/ # Zero-dependency types
│ ├── shaum-calendar/ # Hijri conversion
│ ├── shaum-astronomy/ # VSOP87/ELP2000
│ ├── shaum-rules/ # Fasting jurisprudence
│ ├── shaum-network/ # Async geolocation
│ └── shaum-core/ # Facade crate
├── bindings/
│ ├── shaum_wasm/ # WebAssembly
│ └── shaum_py/ # Python (pyo3)
└── xtask/ # Build automation
Validation
| Component | Method | Precision |
|---|---|---|
| Sun (VSOP87) | Meeus Example 25.a | ~0.27 arcsec |
| Moon (ELP2000) | Meeus Example 47.a | ~0.02 arcsec |
| Historical | Indonesian Ramadan 1938-2024 | 87/87 passed |
References
- Jean Meeus, Astronomical Algorithms (2nd ed.)
- MABIMS visibility criteria (Indonesia/Malaysia/Brunei/Singapore)
- VSOP87 (Bretagnon & Francou, 1988)
- ELP2000-82 (Chapront-Touzé & Chapront, 1983)
License
MIT License. Copyright (c) 2026 Mohammad Farid Hendianto.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shaum-0.8.0.tar.gz.
File metadata
- Download URL: shaum-0.8.0.tar.gz
- Upload date:
- Size: 54.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb29f2b4128bb82a1dfdcc3df49fc597411da666cae32421d3a21a45b5d4b094
|
|
| MD5 |
18b81943eb825f2a64582f765518dfd5
|
|
| BLAKE2b-256 |
9073538c43d065a8ecb882ca44784d60992051c13cda4f18f559be5e0326337f
|
File details
Details for the file shaum-0.8.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: shaum-0.8.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 128.2 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
879480c00b96dda2a983ec19fdef0a7dc61c494ebb6532e6e8b3be96d152ee4b
|
|
| MD5 |
ebe62fc78a74306ddf9e281f9f0ad23a
|
|
| BLAKE2b-256 |
16d5801245d7c566c23445487520a29443bd4849aaffae3ecad3ab9b92aece4f
|