Metadata-Version: 2.4
Name: jyotishcore
Version: 1.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Religion
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: pytest>=7.0 ; extra == 'dev'
Requires-Dist: maturin>=1.0 ; extra == 'dev'
Requires-Dist: twine>=5.0 ; extra == 'dev'
Requires-Dist: mkdocs>=1.5 ; extra == 'docs'
Requires-Dist: pytest>=7.0 ; extra == 'test'
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: test
License-File: LICENSE
Summary: High-performance Vedic astrology calculation engine powered by Rust
Keywords: jyotish,vedic-astrology,panchanga,birth-chart,ephemeris,dasha
Author-email: Sakshyam Banjade <sakshyambanjade@gmail.com>
Requires-Python: >=3.9, <3.15
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/sakshyambanjade/jyotishcore/blob/main/CHANGELOG.md
Project-URL: Documentation, https://jyotishcore.readthedocs.io
Project-URL: Funding, https://github.com/sponsors/sakshyambanjade
Project-URL: Homepage, https://jyotishcore.readthedocs.io
Project-URL: Issues, https://github.com/sakshyambanjade/jyotishcore/issues
Project-URL: Repository, https://github.com/sakshyambanjade/jyotishcore

# ✨ JyotishCore

![PyPI](https://img.shields.io/pypi/v/jyotishcore)
![Python Versions](https://img.shields.io/pypi/pyversions/jyotishcore)
![License](https://img.shields.io/github/license/sakshyambanjade/jyotishcore)
![Build](https://github.com/sakshyambanjade/jyotishcore/actions/workflows/ci.yml/badge.svg)
![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)

> **Disclaimer**: JyotishCore is an astronomical calculation engine, not a deterministic fortune-telling system. Any interpretive text (e.g., Yogas) is classical reference material, not actionable life advice.

**JyotishCore** is a high-performance Vedic Astrology (Jyotisha) calculation library. It is built as a Rust core on top of the Swiss Ephemeris and exposed through a typed, object-oriented Python SDK.

## Features

- **Blazing Fast Calculations:** Rust core enables calculating hundreds of charts in milliseconds using Rayon data-parallelism.
- **Extreme Precision:** Leverages the NASA-backed Swiss Ephemeris (`C` library embedded via Rust).
- **Object-Oriented Python SDK:** Designed for modern developers with strict typing, immutable models (`@dataclass`), and clean interfaces.
- **Regional Panchanga & Calendars:** Native support for the Bikram Sambat (BS) calendar and built-in localization translation mapping for Hindi and Nepali.
- **Muhurta Finder Engine:** Blazing fast step-and-search algorithms to hunt for auspicious time windows in microseconds.

## Performance Benchmark

| Engine | Single Chart | Batch (1,000) | Backend |
|---|---|---|---|
| **JyotishCore (Rust)** | **~0.2 ms** | **~15 ms** | Rust/PyO3 |
| Flatlib | ~5.0 ms | ~4,800 ms | Pure Python |
| SwissEph (Raw) | ~0.5 ms | ~500 ms | C/Python |

## Installation

```bash
pip install jyotishcore
```

## Quick Start

### 1. Modern Object-Oriented Initialization (Recommended)

```python
from jyotishcore import Chart, GeoLocation, JyotishTime, Ayanamsa

# 1. Define Time and Location
time = JyotishTime(year=2024, month=5, day=15, hour=12, minute=0)
location = GeoLocation(latitude=27.7172, longitude=85.3240, timezone="Asia/Kathmandu")

# 2. Compute the Chart
chart = Chart.compute(time=time, location=location, ayanamsa_obj=Ayanamsa.LAHIRI)

# 3. Retrieve Ascendant (Lagna)
print(f"Lagna: {chart.ascendant():.2f}°")

# 4. Explore Planetary Positions
planets = chart.planets()
sun = planets["sun"]
print(f"Sun is in {sun.sign} at {sun.longitude:.2f}° (House {sun.house})")
```

### 2. Regional Panchanga (Localization)

Easily output results in Hindi (`hi`) or Nepali (`ne`).

```python
from jyotishcore import get_panchanga

# Get localized Panchanga in Hindi
p = get_panchanga(
    year=2024, month=5, day=15, hour=12, minute=0, second=0,
    latitude=27.7172, longitude=85.3240,
    locale="hi"
)

print(p.tithi.paksha) # "शुक्ल"
print(p.tithi.name)   # "अष्टमी"
```

## Documentation

Full documentation is available on [ReadTheDocs](https://jyotishcore.readthedocs.io).

## License

This project is dual-licensed under MIT and AGPL (due to Swiss Ephemeris dependency). See the `LICENSE` file for details.

