Skip to main content

Panchang

PyPI Python License: MIT CI

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

panchang-0.2.14-cp313-cp313-win_amd64.whl (474.8 kB view details)

Uploaded CPython 3.13Windows x86-64

panchang-0.2.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (621.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

panchang-0.2.14-cp313-cp313-macosx_11_0_arm64.whl (549.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

panchang-0.2.14-cp312-cp312-win_amd64.whl (475.1 kB view details)

Uploaded CPython 3.12Windows x86-64

panchang-0.2.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (621.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

panchang-0.2.14-cp312-cp312-macosx_11_0_arm64.whl (549.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

panchang-0.2.14-cp311-cp311-win_amd64.whl (475.6 kB view details)

Uploaded CPython 3.11Windows x86-64

panchang-0.2.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (623.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

panchang-0.2.14-cp311-cp311-macosx_11_0_arm64.whl (553.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file panchang-0.2.14-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: panchang-0.2.14-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 474.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for panchang-0.2.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e5f246c85155e363bfc3320f9c7b3603a1ff91c22849d5c34204de9d41fd36af
MD5 33ee9637973c8c5e410bbdafe2bbc638
BLAKE2b-256 b45ca285f5755ddd05eb05cc3607e9dc21125118acc89da1c4ae8091d56cfcf9

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp313-cp313-win_amd64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panchang-0.2.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea3efbaee15e2443cdea7d1aae222e02fad6c4b2f3b427c2b56fb83af16f933d
MD5 abeb78cadeabc3f3cfd99d9bd369039c
BLAKE2b-256 b9967f836b99342892db46d95f636f6bfcf4a28890f3b874abe4e8a1d4278189

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panchang-0.2.14-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83b735e19989ddbe081e347cd730de57a840ac8d5cfa03c2d0f125e0ee0d0320
MD5 ebb20b21205153f5147fb6ad4b690f84
BLAKE2b-256 791a5a12cb2c7c2bd2a968b6129f156ddbe8852740884699094269a99b07276e

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: panchang-0.2.14-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 475.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for panchang-0.2.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 349deef97341c1b32f0a4559c3858ed42c9d3b03e4f69982f356d1c76eb5250b
MD5 8e8ff8af58429d1ad446968937c58a93
BLAKE2b-256 87a771da4053d755f7708f19c91cb270b80da3a7a7d5b6c54fa51e18537b7053

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp312-cp312-win_amd64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panchang-0.2.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de8361dbc3ffac67f2c5dc91d5c5a2a236581ac5807a23410b03d9eb884cd6d2
MD5 eef5dd902cda89cf69ad680c5a3a0586
BLAKE2b-256 f27e3228f1b3c13e291b21b84eebf96623a792169a7a6fbf0bded796dfb3d3a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panchang-0.2.14-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15e5ec43dfb965b9bb7dba2abdc2be7a53f6cf89680d6e683290dafeb6d17f68
MD5 f4f6828288ed91a055940432458e4f25
BLAKE2b-256 742d751524c2397d99e03cdbb8ad38f41b4b032ef7a80c99d195c78a3431554f

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: panchang-0.2.14-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 475.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for panchang-0.2.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6945b99ec634d78b665b60dcd1cac2c047fe54c200959f36db84ef8f52f0f296
MD5 3344c5504e52bb3f467d252ac5c7b51d
BLAKE2b-256 afad76c80425d2382bc441f071a91566febf6cea009ed6608cff01a14884661a

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp311-cp311-win_amd64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panchang-0.2.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26ffba6a5c136693217741e277e982f3d1a59342a077d981b07382460883f2ca
MD5 00c01ea0972c98f1f6c7e317da7f06b5
BLAKE2b-256 ae04a93595296b45d487322d2a26e3dd9d9e5d846760065cbc52fc651ee3d22b

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panchang-0.2.14-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panchang-0.2.14-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d3b30d459ef59ed719309226999d95ce7088a1c8ed997c4e12a91a29ab9adff8
MD5 8c564c43655d1dbb789fd809ec4a6c65
BLAKE2b-256 da42f6c8dd4b2c7f370d526d052186026e3d3f87916acd3f88742e42c5072704

See more details on using hashes here.

Provenance

The following attestation bundles were made for panchang-0.2.14-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on vibzart/panchang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.15

9 files

This release

0.2.14 This release

9 files

0.2.13

9 files

0.2.12

9 files

0.2.11

9 files

0.2.10

9 files

0.2.9

9 files

0.2.8

9 files

0.2.7

9 files

0.2.6

9 files

0.2.5

9 files

0.2.4

9 files

0.2.3

9 files

0.2.2

9 files

0.2.1

9 files

0.2.0

3 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page