-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
56 lines (45 loc) · 1.76 KB
/
example.py
File metadata and controls
56 lines (45 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
KP astrology chart: sub lord and sub-sub lord precision for all 12 cusps and 9 planets.
Uses Placidus houses and KP Newcomb ayanamsa via the RoxyAPI vedic_astrology domain.
"""
import os
from roxy_sdk import create_roxy
roxy = create_roxy(os.environ["ROXY_API_KEY"])
def main():
# Step 1: geocode the birth city - never hardcode coordinates
loc = roxy.location.search_cities(q="New Delhi")
city = loc["cities"][0]
lat = city["latitude"]
lng = city["longitude"]
tz = city["timezone"]
# Step 2: generate the KP astrology chart
chart = roxy.vedic_astrology.generate_kp_chart(
date="1990-07-04",
time="10:12:00",
latitude=lat,
longitude=lng,
timezone=tz,
)
print("Ayanamsa:", chart["meta"]["ayanamsa"])
print("House system:", chart["meta"]["houseSystem"])
print("Ascendant sign:", chart["ascendant"]["sign"])
print("Ascendant sub lord:", chart["ascendant"]["subLord"])
print("\nAll 12 cusps:")
for cusp in chart["cusps"]:
print(
f" House {cusp['house']}: {cusp['sign']} | "
f"star: {cusp['starLord']} | sub: {cusp['subLord']} | ssl: {cusp['subSubLord']}"
)
print("\nPlanets:")
for planet in chart["planets"]:
retro = " (R)" if planet["retrograde"] else ""
print(
f" {planet['planet']}: {planet['sign']} H{planet['house']} "
f"sub={planet['subLord']}{retro}"
)
print("\nRahu:", chart["nodes"]["rahu"]["sign"], "H" + str(chart["nodes"]["rahu"]["house"]),
"sub=" + chart["nodes"]["rahu"]["subLord"])
print("Ketu:", chart["nodes"]["ketu"]["sign"], "H" + str(chart["nodes"]["ketu"]["house"]),
"sub=" + chart["nodes"]["ketu"]["subLord"])
if __name__ == "__main__":
main()