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.20.tar.gz (31.2 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.20-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vedastro-1.23.20.tar.gz
Algorithm Hash digest
SHA256 cbd750f9c3f8798063d255f6b70080cba66a725d8e508d36135ca568e42998df
MD5 29409e0faa061d9d737db0298fe4f55e
BLAKE2b-256 c9cded7b398ac2acf4c3697517f3c689a88a150c9bf27032e9bd00a3ff6c8434

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vedastro-1.23.20-py3-none-any.whl
Algorithm Hash digest
SHA256 e9126527dd63a103bb616cecd8ff767f4a64c4509c6136d192a58a27791cb7e1
MD5 8c1ae161b66af02344ccd7cea4ac8d54
BLAKE2b-256 e697128dc0f09fd6dc8d0d054ef97e7dc6b62b5664d64a412adff7794b6a73df

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