Astro Insight Python SDK
Official, strongly-typed Python 3.9+ SDK for the Astro Insight API. Supports both Synchronous (requests) and Asynchronous (httpx / asyncio) execution modes to easily integrate Vedic Astrology, Western Astrology, Matchmaking, Panchang, Muhurta, Tarot, Numerology, Chinese Astrology, and Geolocation calculations into your Python applications.
Features
- 🪐 Vedic Astrology: Ashtakvarga, Vimshottari / Char / Yogini Dashas, KP System, Jaimini, Lal Kitab, Varshaphal, Ghat Chakra, Horoscope Charts & Doshas.
- 💍 Matchmaking: Guna Milan, Kundali Compatibility, Manglik Matching.
- 🗓️ Panchang & Muhurta: Daily Panchang, Choghadiya, Hora, Shubh Muhurta timing.
- 🔮 Western Astrology & Tarot: Natal Charts, Solar Return, Daily/Weekly/Monthly Transits, Synastry, Tarot spreads (One-card, Three-card, Celtic Cross, Love, Career).
- 🔢 Numerology: Vedic & Western Numerology (Life Path, Destiny, Soul Urge).
- ☯️ Chinese Astrology & Biorhythm: Zodiac sign compatibility & biorhythm calculations.
- 🌍 Geo Utilities: Place search, timezone lookup by coordinates or ID.
- ⚡ Dual Execution Modes: Synchronous (
AstroClient) and Async (AsyncAstroClient) withasyncio. - 🛡️ Strongly Typed Dataclasses:
BirthDetails,MatchInput, andGeoLocationmodels.
Installation
Install the package via pip:
pip install astroinsight-python-sdk
Quick Start
1. Synchronous Client (AstroClient)
from astroinsight import AstroClient, BirthDetails
client = AstroClient(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET"
)
birth = BirthDetails(
day=15, month=8, year=1995,
hour=10, min=30, sec=0,
tzone=5.5, lat=28.6139, lon=77.2090
)
# Fetch Birth Details
details = client.vedic.astro_details.get_birth_details(birth)
print(details["data"]["birth_details"]["day"]) # Tuesday
# Fetch Sun Bhinnashtakavarga
ashtak = client.vedic.ashtakvarga.get_planet_ashtak("sun", birth)
# One Card Tarot Reading
tarot = client.tarot.get_one_card_reading()
2. Asynchronous Client (AsyncAstroClient)
import asyncio
from astroinsight import AsyncAstroClient, BirthDetails
async def main():
async with AsyncAstroClient(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET"
) as async_client:
birth = BirthDetails(day=15, month=8, year=1995, hour=10, min=30)
# Async call
details = await async_client.vedic.astro_details.get_birth_details(birth)
print(details["message"])
asyncio.run(main())
Code Examples
🪐 Vedic Astrology & Dashas
# Major Vimshottari Dasha
dasha = client.vedic.vimshottari_dasha.get_major_dasha(birth)
# Gemstone Suggestions
remedies = client.vedic.suggestions.get_gemstone_suggestions(birth)
# Manglik Dosha Check
manglik = client.vedic.horoscope_dosha.get_manglik_dosha(birth)
💍 Matchmaking (Guna Milan)
from astroinsight import MatchInput
male = BirthDetails(15, 8, 1995, 10, 30, lat=28.6139, lon=77.2090)
female = BirthDetails(20, 11, 1997, 14, 15, lat=19.0760, lon=72.8777)
match_input = MatchInput(male=male, female=female)
# Calculate Guna Milan
score = client.vedic.match_making.get_guna_milan(match_input)
🗓️ Daily Panchang & Muhurta
panchang = client.vedic.panchang.get_daily_panchang(birth)
choghadiya = client.vedic.muhurta.get_choghadiya(birth)
📊 Horoscope & Geo Services
# Daily Horoscope for Leo
leo_daily = client.horoscope.get_daily_horoscope("leo")
# Search Place Coordinates
place_info = client.geo.search_place("Delhi")
Dynamic Configuration & Headers
# Switch language dynamically
client.set_language("hi")
# Switch Ayanamsha system
client.set_ayanamsha("raman")
Exception Handling
from astroinsight import (
AstroClient, BirthDetails,
AuthenticationError, ValidationError, RateLimitError, AstroException
)
client = AstroClient("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
birth = BirthDetails(15, 8, 1995, 10, 30)
try:
response = client.vedic.astro_details.get_birth_details(birth)
except AuthenticationError as e:
print(f"Auth failed: {e.message}")
except ValidationError as e:
print(f"Validation failed: {e.message}, Errors: {e.errors}")
except RateLimitError as e:
print("Rate limit exceeded. Retry later.")
except AstroException as e:
print(f"API Error [{e.status_code}]: {e.message}")
Running Tests
Run unit tests using pytest:
pip install -e .[dev]
python3 -m pytest
License
This SDK is open-sourced software licensed under the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astroinsight_python_sdk-1.0.0.tar.gz.
File metadata
- Download URL: astroinsight_python_sdk-1.0.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e506c1480ead2a9344560042b4fbdf4f4dd024af7b24a45e28a2ba6fdd9fac7d
|
|
| MD5 |
1bd46a34b67f6ad10f941be2e72f40aa
|
|
| BLAKE2b-256 |
88a0a13992bb89cc3e8ba362e02a362113601de36cd4ff65bd647b6335bce6d9
|
File details
Details for the file astroinsight_python_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: astroinsight_python_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f10afbf82b743dc3dc5b9a72f0cad2f672e05d163ee76c01d09035c0cd2f858e
|
|
| MD5 |
49aaa7149a8a84970205fba1c6ea7a39
|
|
| BLAKE2b-256 |
142158f2315112b1f5e3f5bf5e6fd53f67dd5396a96ba9af6af07dfdaba90834
|