|
1 | | -# VedAstro Python |
| 1 | +<p align="center"> |
| 2 | + <img src="docs/banner.png" alt="VedAstro - Vedic Astrology Engine for Python" width="100%"/> |
| 3 | +</p> |
2 | 4 |
|
3 | | -[](https://pypi.org/project/vedastro/) |
4 | | -[](https://pypi.org/project/vedastro/) |
5 | | -[](https://github.com/VedAstro/VedAstro.Python/blob/main/LICENSE) |
| 5 | +<p align="center"> |
| 6 | + <em>The most comprehensive Vedic astrology library for Python — 596 calculations, one line of code.</em> |
| 7 | +</p> |
6 | 8 |
|
7 | | -Python wrapper for the [VedAstro.org](https://vedastro.org) Vedic Astrology API. Perform complex Vedic astrology calculations including planet positions, house analysis, match compatibility, event predictions, and more. |
| 9 | +<p align="center"> |
| 10 | + <a href="https://pypi.org/project/vedastro/"><img src="https://img.shields.io/pypi/v/vedastro?style=flat-square&color=f6d365&label=PyPI" alt="PyPI version"/></a> |
| 11 | + <a href="https://pypi.org/project/vedastro/"><img src="https://img.shields.io/pypi/pyversions/vedastro?style=flat-square&color=a78bfa" alt="Python versions"/></a> |
| 12 | + <a href="https://pepy.tech/project/vedastro"><img src="https://img.shields.io/pepy/dt/vedastro?style=flat-square&color=818cf8&label=Downloads" alt="Downloads"/></a> |
| 13 | + <a href="https://github.com/VedAstro/VedAstro.Python/blob/main/LICENSE"><img src="https://img.shields.io/github/license/VedAstro/VedAstro.Python?style=flat-square&color=fda085" alt="License"/></a> |
| 14 | + <a href="https://github.com/VedAstro/VedAstro.Python/stargazers"><img src="https://img.shields.io/github/stars/VedAstro/VedAstro.Python?style=flat-square&color=f6d365" alt="Stars"/></a> |
| 15 | +</p> |
8 | 16 |
|
9 | | -## Features |
| 17 | +--- |
10 | 18 |
|
11 | | -- **596 API methods** auto-generated from the VedAstro engine |
12 | | -- Planet positions, houses, divisional charts (D1-D60) |
13 | | -- Match compatibility (Kuta system) reports |
14 | | -- Muhurtha / event predictions with time ranges |
15 | | -- AI-powered birth time lookup for famous persons |
16 | | -- Vimshottari Dasa period calculations |
| 19 | +## Why VedAstro? |
| 20 | + |
| 21 | +| | | |
| 22 | +|---|---| |
| 23 | +| **596+ Calculations** | Planet positions, house data, divisional charts (D1–D60), yogas, dasas, and more | |
| 24 | +| **47 Ayanamsa Systems** | Lahiri, Raman, Krishnamurti, Fagan-Bradley (Western), and 43 others | |
| 25 | +| **Match Compatibility** | Full Kuta-based compatibility reports between two horoscopes | |
| 26 | +| **Zero Setup** | Cloud-powered engine — just `pip install` and start calculating | |
| 27 | +| **AI Features** | Birth time auto-fill, horoscope search by natural language | |
| 28 | + |
| 29 | +--- |
17 | 30 |
|
18 | 31 | ## Installation |
19 | 32 |
|
20 | 33 | ```bash |
21 | 34 | pip install vedastro |
22 | 35 | ``` |
23 | 36 |
|
| 37 | +--- |
| 38 | + |
24 | 39 | ## Quick Start |
25 | 40 |
|
| 41 | +### Planet Positions |
| 42 | + |
26 | 43 | ```python |
27 | 44 | from vedastro import * |
28 | 45 |
|
29 | | -# Optional: set API key (get one at vedastro.org/Account) |
30 | | -# Calculate.SetAPIKey("your-api-key") |
| 46 | +Calculate.SetAPIKey('FreeAPIUser') # get your key at vedastro.org/API.html |
31 | 47 |
|
32 | | -# Create location and time |
33 | 48 | geo = GeoLocation("Tokyo, Japan", 139.83, 35.65) |
34 | 49 | birth_time = Time(hour=23, minute=40, day=31, month=12, year=2010, offset="+08:00", geolocation=geo) |
35 | 50 |
|
36 | | -# Alternative: single string format |
37 | | -# birth_time = Time("23:40 31/12/2010 +08:00", geo) |
38 | | - |
39 | | -# Planet data |
40 | | -result = Calculate.AllPlanetData(birth_time, PlanetName.Sun) |
| 51 | +result = Calculate.AllPlanetData(PlanetName.Sun, birth_time) |
41 | 52 | Tools.Print(result) |
| 53 | +``` |
42 | 54 |
|
43 | | -# House data |
44 | | -result = Calculate.AllHouseData(birth_time, HouseName.House1) |
45 | | -Tools.Print(result) |
| 55 | +### Match Compatibility |
| 56 | + |
| 57 | +```python |
| 58 | +from vedastro import * |
| 59 | + |
| 60 | +Calculate.SetAPIKey('FreeAPIUser') |
46 | 61 |
|
47 | | -# Match compatibility |
48 | | -male_geo = GeoLocation("New York, USA", -74.006, 40.7128) |
49 | | -male_time = Time("14:30 15/06/1990 -05:00", male_geo) |
50 | | -female_geo = GeoLocation("London, UK", -0.1276, 51.5074) |
51 | | -female_time = Time("09:15 22/03/1992 +00:00", female_geo) |
| 62 | +romeo = Time("23:40 31/12/1996 +08:00", GeoLocation("Tokyo, Japan", 139.83, 35.65)) |
| 63 | +juliet = Time("14:30 15/06/1997 -05:00", GeoLocation("New York, USA", -74.006, 40.7128)) |
52 | 64 |
|
53 | | -match = Calculate.MatchReport(male_time, female_time) |
54 | | -print(match) |
| 65 | +match = Calculate.MatchReport(romeo, juliet) |
| 66 | +Tools.Print(match) |
55 | 67 | ``` |
56 | 68 |
|
57 | | -## API Key |
| 69 | +### Vimshottari Dasa |
| 70 | + |
| 71 | +```python |
| 72 | +from vedastro import * |
| 73 | +import json |
| 74 | + |
| 75 | +Calculate.SetAPIKey('FreeAPIUser') |
| 76 | + |
| 77 | +geo = GeoLocation("Tokyo, Japan", 139.83, 35.65) |
| 78 | +birth_time = Time("23:40 31/12/2010 +08:00", geo) |
| 79 | +start = Time("00:00 01/01/2020 +08:00", geo) |
| 80 | +end = Time("23:59 31/12/2025 +08:00", geo) |
| 81 | + |
| 82 | +dasa = Calculate.DasaAtRange(birth_time, start, end, levels=3, precision_hours=100) |
| 83 | +print(json.dumps(dasa, indent=4)) |
| 84 | +``` |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## What Can You Calculate? |
| 89 | + |
| 90 | +| Category | Examples | Description | |
| 91 | +|:---------|:---------|:------------| |
| 92 | +| **Planets** | `AllPlanetData`, `PlanetNirayanaLongitude`, `PlanetsInConjunction` | Positions, strengths, aspects, conjunctions | |
| 93 | +| **Houses** | `AllHouseData`, `HouseSignName`, `AllHouseRasiSigns` | Bhava charts, house lords, sign placements | |
| 94 | +| **Zodiac** | `AllZodiacSignData`, `IsPlanetInSign` | Sign-based calculations | |
| 95 | +| **Matching** | `MatchReport`, `MatchReportWithBazi`, `MatchChat` | Kuta compatibility, AI chat analysis | |
| 96 | +| **Events** | `EventsAtTime`, `EventsAtRange`, `EventStartTime` | Muhurtha, event predictions | |
| 97 | +| **Dasa** | `DasaAtRange` | Vimshottari dasa periods with configurable depth | |
| 98 | +| **AI** | `BirthTimeAutoAIFill`, `HoroscopeLLMSearch` | Machine learning birth time, natural language search | |
| 99 | +| **Divisional** | `AllHouseNavamshaSigns`, `AllHouseDrekkanaSigns`, etc. | D1 through D60 charts | |
58 | 100 |
|
59 | | -- Without an API key, requests use the free tier (rate limited) |
60 | | -- Get a subscriber API key at [vedastro.org/Account](https://vedastro.org/Account) |
61 | | -- Set it before making calls: `Calculate.SetAPIKey("your-key")` |
| 101 | +Full API reference: [vedastro.org/API.html](https://vedastro.org/API.html) |
62 | 102 |
|
63 | | -## Method Categories |
| 103 | +--- |
64 | 104 |
|
65 | | -| Category | Examples | |
66 | | -|----------|---------| |
67 | | -| **Planet** | `AllPlanetData`, `PlanetNirayanaLongitude`, `PlanetsInConjunction` | |
68 | | -| **House** | `AllHouseData`, `HouseSignName`, `AllHouseRasiSigns` | |
69 | | -| **Zodiac** | `AllZodiacSignData`, `IsPlanetInSign` | |
70 | | -| **Match** | `MatchReport`, `MatchReportWithBazi`, `MatchChat` | |
71 | | -| **Events** | `EventsAtTime`, `EventsAtRange`, `EventStartTime` | |
72 | | -| **AI** | `BirthTimeAutoAIFill`, `HoroscopeLLMSearch` | |
73 | | -| **Divisional Charts** | `AllHouseNavamshaSigns`, `AllHouseDrekkanaSigns`, etc. | |
| 105 | +## Custom Ayanamsa |
74 | 106 |
|
75 | | -Full API reference: [vedastro.org/APIBuilder](https://vedastro.org/APIBuilder) |
| 107 | +By default, calculations use the **Raman** ayanamsa. Switch to any of the 47 supported systems: |
| 108 | + |
| 109 | +```python |
| 110 | +# Vedic — Lahiri |
| 111 | +Calculate.SetAyanamsa(Ayanamsa.Lahiri) |
| 112 | + |
| 113 | +# Western astrology — Fagan-Bradley |
| 114 | +Calculate.SetAyanamsa(Ayanamsa.Fagan_Bradley) |
| 115 | + |
| 116 | +# KP System — Krishnamurti |
| 117 | +Calculate.SetAyanamsa(Ayanamsa.Krishnamurti) |
| 118 | +``` |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +## API Key |
| 123 | + |
| 124 | +| Tier | Speed | How | |
| 125 | +|:-----|:------|:----| |
| 126 | +| **Free** | Rate limited | No key needed, or use `'FreeAPIUser'` | |
| 127 | +| **Subscriber** | Unlimited | Get key at [vedastro.org/API.html](https://vedastro.org/API.html) | |
| 128 | + |
| 129 | +```python |
| 130 | +Calculate.SetAPIKey('your-key-here') |
| 131 | +``` |
| 132 | + |
| 133 | +--- |
76 | 134 |
|
77 | 135 | ## How It Works |
78 | 136 |
|
79 | | -This package calls the VedAstro REST API, which runs the core Vedic astrology engine on cloud servers. All calculations are performed server-side — no local dependencies beyond Python and `requests`. |
| 137 | +``` |
| 138 | +Your Python Code → vedastro pip library → REST API → VedAstro Engine (cloud) |
| 139 | +``` |
| 140 | + |
| 141 | +All calculations run server-side on the VedAstro engine. No local dependencies beyond Python and `requests`. No DLLs, no native binaries, no setup. |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +## Examples |
| 146 | + |
| 147 | +| Demo File | What It Shows | |
| 148 | +|:----------|:-------------| |
| 149 | +| [`demo_all_astro_data.py`](demo_all_astro_data.py) | All planet and house data for a birth chart | |
| 150 | +| [`demo_all_astro_data_json_output.py`](demo_all_astro_data_json_output.py) | Same as above, with JSON output | |
| 151 | +| [`demo_all_astro_data_csv.py`](demo_all_astro_data_csv.py) | Export astro data to CSV with pandas | |
| 152 | +| [`demo_all_planet_data.py`](demo_all_planet_data.py) | Detailed planet positions with degree parsing | |
| 153 | +| [`demo_bhava_chart_data.py`](demo_bhava_chart_data.py) | Bhava chart house signs and planet placements | |
| 154 | +| [`demo_code_from_api_builder.py`](demo_code_from_api_builder.py) | Code generated from the API Builder tool | |
| 155 | +| [`demo_custom_ayanamsa.py`](demo_custom_ayanamsa.py) | Using a custom ayanamsa system | |
| 156 | +| [`demo_horoscope_prediction_names.py`](demo_horoscope_prediction_names.py) | Horoscope prediction event names | |
| 157 | +| [`demo_match_checker.py`](demo_match_checker.py) | Match compatibility report between two charts | |
| 158 | +| [`demo_vimshottari_dasa.py`](demo_vimshottari_dasa.py) | Vimshottari dasa periods for a time range | |
| 159 | + |
| 160 | +--- |
80 | 161 |
|
81 | 162 | ## Contributing |
82 | 163 |
|
83 | 164 | Contributions welcome! Please open an issue or submit a pull request. |
84 | 165 |
|
85 | | -**Important:** `vedastro/calculate.py` is auto-generated by the [StaticTableGenerator](https://github.com/VedAstro/VedAstro) in the main repo. Do not edit it directly. |
| 166 | +> **Note:** `vedastro/calculate.py` is auto-generated by the [StaticTableGenerator](https://github.com/VedAstro/VedAstro) in the main repo. Do not edit it directly. |
86 | 167 |
|
87 | 168 | ## License |
88 | 169 |
|
89 | 170 | Released under the [MIT License](LICENSE). |
| 171 | + |
| 172 | +--- |
| 173 | + |
| 174 | +<p align="center"> |
| 175 | + <em>Made & Funded by Users — <a href="https://vedastro.org/Donate">Support VedAstro</a></em> |
| 176 | +</p> |
0 commit comments