Python SDK
The official Asterwise Python SDK provides typed access to all 115+ public API endpoints across Vedic + Western astrology, numerology, tarot, crystals, and dreams
Installation
pip install asterwise
Requirements: Python 3.8+
Quick start
import asterwise
from asterwise.api.astrology_api import AstrologyApi
from asterwise.models.natal_request import NatalRequest
configuration = asterwise.Configuration(
host="https://api.asterwise.com",
access_token="YOUR_API_KEY",
)
with asterwise.ApiClient(configuration) as client:
api = AstrologyApi(client)
result = api.natal_chart(NatalRequest(
date="1985-11-12",
time="06:45",
location="Mumbai, India",
ayanamsa="lahiri",
))
print(result.data)
Configuration
configuration = asterwise.Configuration(
host="https://api.asterwise.com",
access_token="YOUR_API_KEY",
)
Get your API key from asterwise.com/dashboard.
API classes
The SDK splits endpoints across API classes by domain:
| Class | Import | Endpoints |
|---|---|---|
AstrologyApi | asterwise.api.astrology_api | natal, dasha, yogas, doshas, matchmaking, panchanga |
Astrology0Api | asterwise.api.astrology0_api | gochar, varshaphal, remedies, gemstones, atmakaraka, KP, Lal Kitab |
AdvancedApi | asterwise.api.advanced_api | divisional, strength, ashtakavarga, transits, yogini, ashtottari |
NumerologyApi | asterwise.api.numerology_api | all 14 numerology endpoints |
HoroscopeApi | asterwise.api.horoscope_api | daily, weekly, monthly, yearly |
UtilitiesApi | asterwise.api.utilities_api | geocode, timezone |
KpApi | asterwise.api.kp_api | KP chart, ruling planets, significators |
LalKitabApi | asterwise.api.lal_kitab_api | Lal Kitab chart, remedies |
PrashnaApi | asterwise.api.prashna_api | prashna |
Examples
Vimshottari Dasha
from asterwise.api.astrology_api import AstrologyApi
from asterwise.models.dasha_request import DashaRequest
with asterwise.ApiClient(configuration) as client:
api = AstrologyApi(client)
result = api.dasha(DashaRequest(
date="1985-11-12",
time="06:45",
location="Mumbai, India",
ayanamsa="lahiri",
levels=2,
))
print(result.data)
Numerology profile
from asterwise.api.numerology_api import NumerologyApi
from asterwise.models.numerology_request import NumerologyRequest
with asterwise.ApiClient(configuration) as client:
api = NumerologyApi(client)
result = api.numerology_profile(NumerologyRequest(
name="Arjun Mehta",
date="1985-11-12",
))
print(result.data)
Matchmaking
from asterwise.api.astrology_api import AstrologyApi
from asterwise.models.matchmaking_request import MatchmakingRequest
from asterwise.models.birth_input import BirthInput
person1 = BirthInput(
date="1985-11-12", time="06:45",
location="Mumbai, India", ayanamsa="lahiri"
)
person2 = BirthInput(
date="1990-06-21", time="15:30",
location="Rome, Italy", ayanamsa="lahiri"
)
with asterwise.ApiClient(configuration) as client:
api = AstrologyApi(client)
result = api.matchmaking(MatchmakingRequest(
person1=person1,
person2=person2,
))
print(result.data)