Skip to main content

High-performance Vedic astrology calculation engine powered by Rust

Project description

✨ JyotishCore

PyPI Python Versions License Build Coverage

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 the world's most accurate, high-performance Vedic Astrology (Jyotisha) calculation engine. Powered by a Rust backend built on the Swiss Ephemeris and exposed via an elegant, 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.
  • Interactive Developer Dashboard: Comes with a built-in Streamlit playground to test and evaluate the API instantly.
  • 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

pip install jyotishcore

To install the optional interactive developer dashboard:

pip install "jyotishcore[ui]"

Quick Start

1. Modern Object-Oriented Initialization (Recommended)

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).

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)   # "अष्टमी"

Interactive Dashboard

If you installed the ui extra, you can launch the interactive dashboard locally:

jyotishcore-ui

This will boot a Streamlit app where you can tweak parameters, calculate natal charts, view panchangas, and run the Muhurta finder directly in your browser.

Documentation

Full documentation is available on ReadTheDocs.

License

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

Project details


Download files

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

Source Distribution

jyotishcore-1.0.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

jyotishcore-1.0.0-cp38-abi3-macosx_11_0_arm64.whl (909.0 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file jyotishcore-1.0.0.tar.gz.

File metadata

  • Download URL: jyotishcore-1.0.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for jyotishcore-1.0.0.tar.gz
Algorithm Hash digest
SHA256 313a27b41b891b6e1f9694a1569068ccb04707e0b3e8e6c963268631a5668ae0
MD5 db006a70f5c7cfc41a95bdaba9a82852
BLAKE2b-256 2e380c774cae5b05695f2b04a985281e1676d3dd3d998ef9329036fdbe541fd7

See more details on using hashes here.

File details

Details for the file jyotishcore-1.0.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jyotishcore-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15d5f36799b21a74f772a63925cdd2785b5408e655bf312eafe5653d56fffc37
MD5 4dba7b220c227315f474877d3270967f
BLAKE2b-256 36fef0cdb6e06e542b1b634ed0a0ee8bd62bb5cb597d4114a0535daad5554755

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page