Skip to content

Commit f3b9c51

Browse files
committed
fix Time class, improved for better coding ⌚⌛🚀🤘
1 parent a52c154 commit f3b9c51

25 files changed

Lines changed: 3471 additions & 2527 deletions

.github/workflows/publish-to-pypi.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
name: Publish to PyPI
66
on:
7+
push:
8+
branches:
9+
- main
10+
paths-ignore:
11+
- '**.md' # Ignore changes to Markdown files to prevent infinite loop
712
workflow_dispatch:
813
jobs:
914
deploy:
@@ -14,13 +19,13 @@ jobs:
1419
- name: Set up Python
1520
uses: actions/setup-python@v2
1621
with:
17-
python-version: '3.12' # Specify a compatible Python version
22+
python-version: '3.x'
1823
- name: Install dependencies
1924
run: |
2025
python -m pip install --upgrade pip
2126
pip install poetry
22-
- name: Re-run poetry lockfile
23-
run: poetry lock # Removed the --no-update option
27+
- name: re run poetry lockfile
28+
run: poetry lock --no-update
2429
- name: Install project dependencies
2530
run: poetry install
2631
- name: Build package

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
vedastro/__pycache__/
33

4-
vedastro/calculators/__pycache__/
5-
6-
vedastro/objects/__pycache__/
7-
84
.vs/
95

106
__pycache__/

.idea/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/VedAstro.Python.iml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 58 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,89 @@
1-
<h1> ✨ Vedic Astrology in Python</h1>
1+
# VedAstro Python
22

3+
[![PyPI version](https://img.shields.io/pypi/v/vedastro)](https://pypi.org/project/vedastro/)
4+
[![Python](https://img.shields.io/pypi/pyversions/vedastro)](https://pypi.org/project/vedastro/)
35
[![License](https://img.shields.io/github/license/VedAstro/VedAstro.Python)](https://github.com/VedAstro/VedAstro.Python/blob/main/LICENSE)
4-
[![GitHub Issues](https://img.shields.io/github/issues/VedAstro/VedAstro.Python)](https://github.com/VedAstro/VedAstro.Python/issues)
56

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

7-
# 🙏 How VedAstro can help you...
9+
## Features
810

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
1217

18+
## Installation
1319

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+
```
2023

21-
**Step 1:** Run `pip install vedastro`
24+
## Quick Start
2225

23-
**Step 2:** Do astro calculation in less than 10 lines
2426
```python
25-
from vedastro import *
27+
from vedastro import *
2628

27-
#PART 1 : PREPARE NEEDED DATA
28-
#-----------------------------------
29+
# Optional: set API key (get one at vedastro.org/Account)
30+
# Calculate.SetAPIKey("your-api-key")
2931

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

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

36-
#PART 2 : CALCULATE ALL DATA
37-
#-----------------------------------
39+
# Planet data
40+
result = Calculate.AllPlanetData(birth_time, PlanetName.Sun)
41+
Tools.Print(result)
3842

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

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

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)
5055
```
5156

52-
**Step 3:** Done ✅
57+
## API Key
5358

54-
# 🧮 +400 Calculations
55-
![400-plus-calculation-python](https://vedastro.org/images/400-plus-calculation-python.gif)
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")`
5662

63+
## Method Categories
5764

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

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

77+
## How It Works
6278

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`.
6480

6581
## Contributing
6682

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

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

87+
## License
7388

89+
Released under the [MIT License](LICENSE).

demo_all_astro_data.py

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from vedastro import * # install via pip
22

3-
# PART 0 : Set API key
4-
Calculate.SetAPIKey('FreeAPIUser') # ⚡ unlimited speed API key from "vedastro.org/Account"
53

64
#PART 1 : PREPARE NEEDED DATA
75
#-----------------------------------
@@ -16,46 +14,15 @@
1614
#PART 2 : CALCULATE ALL DATA
1715
#-----------------------------------
1816

19-
#HOROSCOPE PREDICTIONS
20-
horoscopePredictions = Calculate.HoroscopePredictions(birth_time, "Empty")
21-
print(json.dumps(horoscopePredictions, indent=4))
22-
2317
#PLANETS
2418
allPlanetDataList = Calculate.AllPlanetData(PlanetName.Sun, birth_time)
25-
print(json.dumps(allPlanetDataList, indent=4))
19+
Tools.Print(allPlanetDataList)
2620

2721
#HOUSES
2822
allHouseDataList = Calculate.AllHouseData(HouseName.House1, birth_time)
29-
print(json.dumps(allHouseDataList, indent=4))
23+
Tools.Print(allHouseDataList)
3024

3125
#ZODIAC SIGNS
3226
allZodiacDataList = Calculate.AllZodiacSignData(ZodiacName.Gemini, birth_time)
33-
print(json.dumps(allZodiacDataList, indent=4))
34-
35-
#SUNRISE TIME
36-
sunriseTime = Calculate.SunriseTime(birth_time)
37-
print(json.dumps(sunriseTime, indent=4))
38-
39-
#SUNSET TIME
40-
sunsetTime = Calculate.SunsetTime(birth_time)
41-
print(json.dumps(sunriseTime, indent=4))
42-
43-
#Panchanga Table
44-
panchangaTable = Calculate.PanchangaTable(birth_time)
45-
print(json.dumps(panchangaTable, indent=4))
46-
47-
#Lagna Sign Name
48-
panchangaTable = Calculate.LagnaSignName(birth_time)
49-
print(json.dumps(panchangaTable, indent=4))
50-
51-
#Bhinnashtakavarga Chart
52-
bhinnashtakavarga = Calculate.BhinnashtakavargaChart(birth_time)
53-
print(json.dumps(bhinnashtakavarga, indent=4))
54-
55-
#Gulika Longitude
56-
gulikaLongitude = Calculate.GulikaLongitude(birth_time)
57-
print(json.dumps(gulikaLongitude, indent=4))
27+
Tools.Print(allZodiacDataList)
5828

59-
#Day of week
60-
dayOfWeek = Calculate.DayOfWeek(birth_time)
61-
print(json.dumps(dayOfWeek, indent=4))

0 commit comments

Comments
 (0)