Panchang
Bhāratīya calendar infrastructure for developers — Panchang, festivals, muhurat, regional calendars, and batch computation.
Built on a Rust computation engine with Swiss Ephemeris precision. Not an astrology API. It answers: "What is happening in the Bhāratīya calendar right now, at this location?"
from datetime import date
from panchang import panchang, calendar, Location
delhi = Location(lat=28.6139, lng=77.2090, tz="Asia/Kolkata")
# Daily Panchang
today = panchang.compute(date.today(), delhi)
print(today.tithi.paksha, today.tithi.name) # "Shukla Dvitiya"
print(today.nakshatra.name) # "Pushya"
print(today.nakshatra.pada) # 3
print(today.sun.sunrise) # 2026-03-03 06:42:18+05:30
# Festival dates
festivals = calendar.compute_festivals(2026, delhi)
for f in festivals[:3]:
print(f"{f.name}: {f.date}")
# Makar Sankranti: 2026-01-14
# Vasant Panchami: 2026-02-01
# Maha Shivaratri: 2026-02-15
Install
pip install panchang
Requires Python 3.11+. Wheels available for Linux, macOS, and Windows.
Features
Panchang (Daily Calendar)
All 5 Panchanga elements with precise transition times (start/end to the second):
- Tithi (lunar day) — with Paksha (Shukla/Krishna)
- Nakshatra (lunar mansion) — with Pada (1-4)
- Yoga (Sun-Moon combination)
- Karana (half-tithi)
- Vara (weekday)
Sun & Moon
- Sunrise/sunset using Hindu rising model (disc center at horizon, Bhāratīya atmospheric refraction)
- Location-aware computation for any lat/lng/timezone
Muhurat (Auspicious Windows)
- Rahu Kalam, Yama Gandam, Gulika Kalam
- Abhijit Muhurat
- Choghadiya (16 windows per day — 8 day + 8 night)
Festivals
55+ Hindu festivals astronomically computed for any year:
- Tithi-based: Diwali, Holi, Janmashtami, Ram Navami, Ganesh Chaturthi, Navaratri, ...
- Sankranti-based: Makar Sankranti, Pongal, Vishu, Bihu, ...
- Nakshatra-based: Onam (Thiruvonam)
- Ekadashi: All 24 per year with Smartha and Vaishnava dates — 26 in Adhika-maas years (Padmini + Parama, flagged
is_adhik) - Vrat dates: Pradosh, Sankashti Chaturthi, Amavasya, Purnima (~60 per year)
Festival definitions are data-driven (YAML, not hardcoded) with year-agnostic astronomical rules. Each resolved date includes a reasoning string explaining the determination.
Regional Calendars
8 regional calendar systems with proper era numbering:
- Solar: Tamil, Bengali, Malayalam, Kannada
- Lunar: Hindi, Marathi, Telugu, Gujarati
- Era support: Vikram Samvat, Shaka Samvat, Bangabda, Kollavarsham, Thiruvalluvar, 60-year Jovian cycle
Lunar Months
- Both Amant (South Bhārat) and Purnimant (North Bhārat) systems
- Adhik Maas (intercalary month) and Kshaya Maas detection
Shraddha Tithi
Death anniversary date resolution — given a death date, computes the Shraddha date for any target year using the lunar tithi and month.
Batch Computation
Full-year or date-range Panchang in a single call:
from panchang import batch, Location
delhi = Location(lat=28.6139, lng=77.2090, tz="Asia/Kolkata")
year_data = batch.compute_year(2026, delhi) # 365 days of Panchang
Accuracy
All computations use the Swiss Ephemeris (Moshier analytical model) with Lahiri/Chitrapaksha Ayanamsa — the Government of Bhārat standard.
Cross-validated against Drik Panchang for 2026-02-24, Delhi:
| Element | Drik Panchang | Panchang | Delta |
|---|---|---|---|
| Sunrise | 06:51 | 06:55 | ~4 min |
| Tithi | Shukla Saptami until 07:01 | Shukla Saptami until 07:02 | ~1 min |
| Nakshatra | Krittika until 15:07 | Krittika until 15:07 | exact |
| Yoga | Indra until 07:24 | Indra until 07:23 | ~1 min |
| Karana | Vanija until 07:01 | Vanija until 07:02 | ~1 min |
| Rahu Kalam | 15:26-16:52 | 15:24-16:48 | ~2 min |
All element names match exactly. Timing differences are 1-5 minutes due to sunrise geometric model variations.
Architecture
Rust core + Python API. All astronomical math runs in Rust via PyO3, giving C-level performance with a Pythonic interface.
Python (pydantic models, typed API)
└── Rust via PyO3 (panchang, festivals, muhurat, batch)
└── Swiss Ephemeris C (planetary positions via FFI)
Performance (Rust benchmarks):
- Full Panchang: ~3.7 ms
- Sunrise: ~29 µs
- All 9 planets: ~7 µs
Development
# Setup
uv venv
uv pip install -e ".[dev]"
# Build Rust extension
maturin develop --uv
# Run tests
uv run pytest tests/ -v
cargo test --manifest-path crates/panchang-core/Cargo.toml -- --test-threads=1
# Lint
uv run ruff check python/ tests/
cargo clippy --manifest-path crates/panchang-core/Cargo.toml -- -D warnings
Tech Stack
| Layer | Technology |
|---|---|
| Computation | Rust + PyO3 |
| Ephemeris | Swiss Ephemeris (vendored C, Moshier model) |
| Python | 3.11+ with Pydantic v2 |
| Build | maturin + uv |
| Testing | pytest + proptest + criterion |
| CI | GitHub Actions + maturin-action |
Contributing
Contributions welcome! Please open an issue first to discuss what you'd like to change.
# Run the full check suite before submitting
uv run ruff check python/ tests/
uv run pytest tests/ -v
cargo test --manifest-path crates/panchang-core/Cargo.toml -- --test-threads=1
cargo clippy --manifest-path crates/panchang-core/Cargo.toml -- -D warnings
License
MIT
Metadata
Release files for panchang 0.2.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 5.0 MB
Release files / panchang-0.2.15-cp313-cp313-win_amd64.whl
| Download URL | panchang-0.2.15-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 477.6 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9d7820d5b202038e143e53cb6d551a57e0ef2adaa31060269b760cd6a74697b8
|
|
BLAKE2b-256 checksum How to use checksums |
ee7acf1009a868b178c06e5c209a76284d3c3a9cdf1c407cca6a4c52a7500c18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | panchang-0.2.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 624.0 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
5fda3bc591e7d7c1596d28445ea17d139a48ab37e915ee26f7a1b597b1c3869d
|
|
BLAKE2b-256 checksum How to use checksums |
c50edbdb95f0258b7a8e2d16d86ce5897ca83ffa40d80e13122bdd57ac3cfc86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | panchang-0.2.15-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 551.5 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c6e3497ff582aeca736c84759d0b7b70831fa81cabae1917447de22a6396c5be
|
|
BLAKE2b-256 checksum How to use checksums |
2d20ed0d54fb01cb70c378d65d08eb58eedf43629c65b0a31652302e132a1669
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp312-cp312-win_amd64.whl
| Download URL | panchang-0.2.15-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 477.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0e94603f1f24614edd8b78eb064e6471bf115dddcf2a4de6af1eb0ea0d5f4140
|
|
BLAKE2b-256 checksum How to use checksums |
1706e901c6aedc8e90fb2c6297b3c83c5e99536f090c92f6f4973f8b0ecdd79c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | panchang-0.2.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 624.5 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d907911f788610b6a9c25888b0880506a7d18b4c582c47e3f99bd787f23b9445
|
|
BLAKE2b-256 checksum How to use checksums |
2f24da24e6e91f00757fbe9349a9f9a48c72bbc565eb2ef9b9bb9bce0de7b904
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | panchang-0.2.15-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 552.1 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
df7a2dab60eacc26f2bc6f85682d889c1166c5abea85cc70c104c67dc97c1ed0
|
|
BLAKE2b-256 checksum How to use checksums |
8146d1cc06603d08a3210888990e5e95b48f0384bcbe0dad90890bf706c86e16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp311-cp311-win_amd64.whl
| Download URL | panchang-0.2.15-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 478.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b07d891e87911fcd8c350536a168aff02cfa8c7cba153ed8fcef95b0b17d59aa
|
|
BLAKE2b-256 checksum How to use checksums |
40774a63c64820fa4a4171868070cf375227c2568a9f86345119606d749a9313
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | panchang-0.2.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 625.7 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
7937e88bb976ba8de30af2eebadc5299efa3feef1e250f569906ef9fad3e3171
|
|
BLAKE2b-256 checksum How to use checksums |
e39f919dc42774d65b699a4fde8c3f89c380a9e1ba67d89c08260e505967e7a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logRelease files / panchang-0.2.15-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | panchang-0.2.15-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 555.5 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c79cece731d2883ce6356f591e6ad2e12f80a751635889b5bb923890712d68df
|
|
BLAKE2b-256 checksum How to use checksums |
a15e10f333474eb7530d764adb6a67948aa6b8c29f3f2b3a36a79494cc4c728f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logSecurity for panchang 0.2.15
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.
Full provenance
All 9 files in this release have been uploaded with provenance metadata.
Attestation for panchang-0.2.15-cp313-cp313-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.
Transparency logA 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.