Skip to main content

An open source Python library for advanced astronomical calculations like planet longitude, house sign, shadbala, etc...

Project description

VedAstro - Vedic Astrology Engine for Python

The most comprehensive Vedic astrology library for Python — 596 calculations, one line of code.

PyPI version Python versions Downloads License Stars


Why VedAstro?

596+ Calculations Planet positions, house data, divisional charts (D1–D60), yogas, dasas, and more
47 Ayanamsa Systems Lahiri, Raman, Krishnamurti, Fagan-Bradley (Western), and 43 others
Match Compatibility Full Kuta-based compatibility reports between two horoscopes
Zero Setup Cloud-powered engine — just pip install and start calculating
AI Features Birth time auto-fill, horoscope search by natural language

Installation

pip install vedastro

Quick Start

Planet Positions

from vedastro import *

Calculate.SetAPIKey('FreeAPIUser')  # get your key at vedastro.org/API.html

geo = GeoLocation("Tokyo, Japan", 139.83, 35.65)
birth_time = Time(hour=23, minute=40, day=31, month=12, year=2010, offset="+08:00", geolocation=geo)

result = Calculate.AllPlanetData(PlanetName.Sun, birth_time)
Tools.Print(result)

Match Compatibility

from vedastro import *

Calculate.SetAPIKey('FreeAPIUser')

romeo = Time("23:40 31/12/1996 +08:00", GeoLocation("Tokyo, Japan", 139.83, 35.65))
juliet = Time("14:30 15/06/1997 -05:00", GeoLocation("New York, USA", -74.006, 40.7128))

match = Calculate.MatchReport(romeo, juliet)
Tools.Print(match)

Vimshottari Dasa

from vedastro import *
import json

Calculate.SetAPIKey('FreeAPIUser')

geo = GeoLocation("Tokyo, Japan", 139.83, 35.65)
birth_time = Time("23:40 31/12/2010 +08:00", geo)
start = Time("00:00 01/01/2020 +08:00", geo)
end = Time("23:59 31/12/2025 +08:00", geo)

dasa = Calculate.DasaAtRange(birth_time, start, end, levels=3, precision_hours=100)
print(json.dumps(dasa, indent=4))

What Can You Calculate?

Category Examples Description
Planets AllPlanetData, PlanetNirayanaLongitude, PlanetsInConjunction Positions, strengths, aspects, conjunctions
Houses AllHouseData, HouseSignName, AllHouseRasiSigns Bhava charts, house lords, sign placements
Zodiac AllZodiacSignData, IsPlanetInSign Sign-based calculations
Matching MatchReport, MatchReportWithBazi, MatchChat Kuta compatibility, AI chat analysis
Events EventsAtTime, EventsAtRange, EventStartTime Muhurtha, event predictions
Dasa DasaAtRange Vimshottari dasa periods with configurable depth
AI BirthTimeAutoAIFill, HoroscopeLLMSearch Machine learning birth time, natural language search
Divisional AllHouseNavamshaSigns, AllHouseDrekkanaSigns, etc. D1 through D60 charts

Full API reference: vedastro.org/API.html


Custom Ayanamsa

By default, calculations use the Raman ayanamsa. Switch to any of the 47 supported systems:

# Vedic — Lahiri
Calculate.SetAyanamsa(Ayanamsa.Lahiri)

# Western astrology — Fagan-Bradley
Calculate.SetAyanamsa(Ayanamsa.Fagan_Bradley)

# KP System — Krishnamurti
Calculate.SetAyanamsa(Ayanamsa.Krishnamurti)

API Key

Tier Speed How
Free Rate limited No key needed, or use 'FreeAPIUser'
Subscriber Unlimited Get key at vedastro.org/API.html
Calculate.SetAPIKey('your-key-here')

How It Works

Your Python Code  →  vedastro pip library  →  REST API  →  VedAstro Engine (cloud)

All calculations run server-side on the VedAstro engine. No local dependencies beyond Python and requests. No DLLs, no native binaries, no setup.


Examples

Demo File What It Shows
demo_all_astro_data.py All planet and house data for a birth chart
demo_all_astro_data_json_output.py Same as above, with JSON output
demo_all_astro_data_csv.py Export astro data to CSV with pandas
demo_all_planet_data.py Detailed planet positions with degree parsing
demo_bhava_chart_data.py Bhava chart house signs and planet placements
demo_code_from_api_builder.py Code generated from the API Builder tool
demo_custom_ayanamsa.py Using a custom ayanamsa system
demo_horoscope_prediction_names.py Horoscope prediction event names
demo_match_checker.py Match compatibility report between two charts
demo_vimshottari_dasa.py Vimshottari dasa periods for a time range

Contributing

Contributions welcome! Please open an issue or submit a pull request.

Note: vedastro/calculate.py is auto-generated by the StaticTableGenerator in the main repo. Do not edit it directly.

License

Released under the MIT License.


Made & Funded by Users — Support VedAstro

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

vedastro-1.23.21.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

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

vedastro-1.23.21-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file vedastro-1.23.21.tar.gz.

File metadata

  • Download URL: vedastro-1.23.21.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vedastro-1.23.21.tar.gz
Algorithm Hash digest
SHA256 84ffedc7f09e2f6c66abd20c65eeff17ad21c0eb1779440f782291fa99ac980b
MD5 fdd4a7d8c415901074b9664ce3007298
BLAKE2b-256 de28ec5814cf3f524431a147e8131e6c752a3dc67f6b1e0228de757147ace73c

See more details on using hashes here.

File details

Details for the file vedastro-1.23.21-py3-none-any.whl.

File metadata

  • Download URL: vedastro-1.23.21-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vedastro-1.23.21-py3-none-any.whl
Algorithm Hash digest
SHA256 c11bf5f261b9835d22ef37e15332f0f06c99571669ea1176db84afc89e620287
MD5 0e617eaba2a640205767be15e2cb610d
BLAKE2b-256 a8f6f6a4afaef2aed8097fda2e676f1c697b400a597276151893035b73ff2570

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