Metadata-Version: 2.4
Name: drik-panchanga
Version: 1.0.0
Summary: Observational Indian lunisolar calendar (Drik Panchanga) using Swiss Ephemeris
Author: Satish BD
License-Expression: AGPL-3.0-or-later
Project-URL: Homepage, https://github.com/bdsatish/drik-panchanga
Project-URL: Repository, https://github.com/bdsatish/drik-panchanga
Project-URL: Issues, https://github.com/bdsatish/drik-panchanga/issues
Keywords: panchanga,hindu,calendar,tithi,nakshatra,swiss-ephemeris,pdf,calendar-pdf
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Religion
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Printing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyswisseph
Requires-Dist: tzdata; platform_system == "Windows"
Provides-Extra: pdf
Requires-Dist: reportlab; extra == "pdf"
Provides-Extra: all
Requires-Dist: reportlab; extra == "all"
Dynamic: license-file

# drik-panchanga

Observational Indian lunisolar calendar (Hindu Drig-ganita / Drik Panchanga)
using the [Swiss Ephemeris](https://www.astro.com/swisseph/).

This PyPI package installs the core library module `panchanga.py`, plus the
PDF calendar generators behind the `[pdf]` extra:

```bash
pip install drik-panchanga          # core library only
pip install "drik-panchanga[pdf]"   # + reportlab, PDF console scripts
```

With the `[pdf]` extra, two console commands are available:

- `drik-panchanga-short` — one-page A4 landscape panchanga for 14 months
- `drik-panchanga-long` — 12-page A4 portrait wall calendar

```bash
drik-panchanga-short --city "Bengaluru, IN" --start 2026-06
```

## Ephemeris data

Swiss Ephemeris needs `.se1` data files. Either set `SE_EPHE_PATH` to a
directory that contains them, or place them in the default location used by
this library:

- Linux / macOS: `~/.local/share/swisseph` (or `$XDG_DATA_HOME/swisseph`)
- Windows: `%LOCALAPPDATA%\swisseph`

## Usage

```python
import panchanga

panchanga.set_chosen_ayanamsa("citra")
place = panchanga.Place(12.972, 77.594, +5.5)  # lat, lon, timezone hours
jd = panchanga.gregorian_to_jd(panchanga.Date(2026, 1, 15))
print(panchanga.tithi(jd, place))
print(panchanga.nakshatra(jd, place))
print(panchanga.masa(jd, place, amanta=True))   # or amanta=False for pūrṇimānta
```

For tropical (sāyana) values instead of sidereal, call
`set_coordinate_mode("tropical")` before computing; reset with
`set_coordinate_mode("sidereal")`:

```python
panchanga.set_coordinate_mode("tropical")
print(panchanga.tithi(jd, place))          # tithi from tropical longitudes
print(panchanga.masa(jd, place, amanta=True))
panchanga.set_coordinate_mode("sidereal")
```

Full source, GUI, festival rules, and PDF calendar live in the
[GitHub repository](https://github.com/bdsatish/drik-panchanga).

## License

GNU Affero General Public License v3 or later (AGPL-3.0-or-later).
