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.
Metadata
Release files for shaum 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shaum-0.8.0.tar.gz | 54.5 kB | Without provenance | Details for shaum-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shaum-0.8.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details for shaum-0.8.0-cp311-cp311-win_amd64.whl |
Total release size: 182.8 kB
Release files / shaum-0.8.0.tar.gz
| Download URL | shaum-0.8.0.tar.gz |
|---|---|
| Size | 54.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb29f2b4128bb82a1dfdcc3df49fc597411da666cae32421d3a21a45b5d4b094
|
|
BLAKE2b-256 checksum How to use checksums |
9073538c43d065a8ecb882ca44784d60992051c13cda4f18f559be5e0326337f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.2
|
Release files / shaum-0.8.0-cp311-cp311-win_amd64.whl
| Download URL | shaum-0.8.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 128.2 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
879480c00b96dda2a983ec19fdef0a7dc61c494ebb6532e6e8b3be96d152ee4b
|
|
BLAKE2b-256 checksum How to use checksums |
16d5801245d7c566c23445487520a29443bd4849aaffae3ecad3ab9b92aece4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.2
|
Security for shaum 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.