|
1 | | -<h1> ✨ Vedic Astrology in Python</h1> |
| 1 | +# VedAstro Python |
2 | 2 |
|
| 3 | +[](https://pypi.org/project/vedastro/) |
| 4 | +[](https://pypi.org/project/vedastro/) |
3 | 5 | [](https://github.com/VedAstro/VedAstro.Python/blob/main/LICENSE) |
4 | | -[](https://github.com/VedAstro/VedAstro.Python/issues) |
5 | 6 |
|
| 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. |
6 | 8 |
|
7 | | -# 🙏 How VedAstro can help you... |
| 9 | +## Features |
8 | 10 |
|
9 | | -- [Website](https://vedastro.org) --> easy & fast astrology data for **normal users** |
10 | | -- [AI Astrologer](https://vedastro.org/AstrologerChat.html) --> 🤖 World's 1st open source **Vedic AI astrologer** |
11 | | -- [Numerology](https://vedastro.org/Numerology.html) --> Accurate Name Numerology using **Mantra Shastra** |
| 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 |
12 | 17 |
|
| 18 | +## Installation |
13 | 19 |
|
14 | | -# 🗺️ What can this do? |
15 | | -Easily code complex vedic astrology math and logic. |
16 | | -A powerful tool for astronomical calculations and data analysis. It provides a collection of functions and classes to perform various astronomical calculations, such as celestial object positions, time conversions, coordinate transformations, and more. |
17 | | - |
18 | | - |
19 | | -# 🏎️ Quick Start |
| 20 | +```bash |
| 21 | +pip install vedastro |
| 22 | +``` |
20 | 23 |
|
21 | | -**Step 1:** Run `pip install vedastro` |
| 24 | +## Quick Start |
22 | 25 |
|
23 | | -**Step 2:** Do astro calculation in less than 10 lines |
24 | 26 | ```python |
25 | | -from vedastro import * |
| 27 | +from vedastro import * |
26 | 28 |
|
27 | | -#PART 1 : PREPARE NEEDED DATA |
28 | | -#----------------------------------- |
| 29 | +# Optional: set API key (get one at vedastro.org/Account) |
| 30 | +# Calculate.SetAPIKey("your-api-key") |
29 | 31 |
|
30 | | -# set birth location |
31 | | -geolocation = GeoLocation("Tokyo, Japan", 139.83, 35.65) |
| 32 | +# Create location and time |
| 33 | +geo = GeoLocation("Tokyo, Japan", 139.83, 35.65) |
| 34 | +birth_time = Time(hour=23, minute=40, day=31, month=12, year=2010, offset="+08:00", geolocation=geo) |
32 | 35 |
|
33 | | -# group all birth time data together (day/month/year) |
34 | | -birth_time = Time("23:40 31/12/2010 +08:00", geolocation) |
| 36 | +# Alternative: single string format |
| 37 | +# birth_time = Time("23:40 31/12/2010 +08:00", geo) |
35 | 38 |
|
36 | | -#PART 2 : CALCULATE ALL DATA |
37 | | -#----------------------------------- |
| 39 | +# Planet data |
| 40 | +result = Calculate.AllPlanetData(birth_time, PlanetName.Sun) |
| 41 | +Tools.Print(result) |
38 | 42 |
|
39 | | -#PLANETS |
40 | | -allPlanetDataList = Calculate.AllPlanetData(PlanetName.Sun, birth_time) |
41 | | -print(json.dumps(allPlanetDataList, indent=4)) |
| 43 | +# House data |
| 44 | +result = Calculate.AllHouseData(birth_time, HouseName.House1) |
| 45 | +Tools.Print(result) |
42 | 46 |
|
43 | | -#HOUSES |
44 | | -allHouseDataList = Calculate.AllHouseData(HouseName.House1, birth_time) |
45 | | -print(json.dumps(allHouseDataList, indent=4)) |
| 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) |
46 | 52 |
|
47 | | -#ZODIAC SIGNS |
48 | | -allZodiacDataList = Calculate.AllZodiacSignData(ZodiacName.Gemini, birth_time) |
49 | | -print(json.dumps(allZodiacDataList, indent=4)) |
| 53 | +match = Calculate.MatchReport(male_time, female_time) |
| 54 | +print(match) |
50 | 55 | ``` |
51 | 56 |
|
52 | | -**Step 3:** Done ✅ |
| 57 | +## API Key |
53 | 58 |
|
54 | | -# 🧮 +400 Calculations |
55 | | - |
| 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")` |
56 | 62 |
|
| 63 | +## Method Categories |
57 | 64 |
|
| 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. | |
58 | 74 |
|
59 | | -# ⚙️ How it works |
60 | | -Coded & compiled [in C#](https://github.com/VedAstro/VedAstro) for **maximum CPU computation efficency and speed**, then made available in a Python wrapper. Can be run in Linux, Windows & Mac OS. |
| 75 | +Full API reference: [vedastro.org/APIBuilder](https://vedastro.org/APIBuilder) |
61 | 76 |
|
| 77 | +## How It Works |
62 | 78 |
|
63 | | -------------------- |
| 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`. |
64 | 80 |
|
65 | 81 | ## Contributing |
66 | 82 |
|
67 | | -Contributions to VedAstro Python are welcome! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request. Make sure to read our [contribution guidelines](https://github.com/VedAstro/VedAstro.Python/CONTRIBUTING.md) before getting started. |
| 83 | +Contributions welcome! Please open an issue or submit a pull request. |
68 | 84 |
|
69 | | -## License |
70 | | - |
71 | | -VedAstro Python is released under the MIT License. See [LICENSE](https://github.com/VedAstro/VedAstro.Python/LICENSE) for more information. |
| 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. |
72 | 86 |
|
| 87 | +## License |
73 | 88 |
|
| 89 | +Released under the [MIT License](LICENSE). |
0 commit comments