-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
35 lines (27 loc) · 1.13 KB
/
Copy pathexample.py
File metadata and controls
35 lines (27 loc) · 1.13 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
"""
Current moon phase: lunar phase name, illumination percentage, lunar age, zodiac sign, degree, distance.
Returns moon phase meaning (energy direction, keywords) for moon tracking apps and lunar calendars.
Part of the RoxyAPI Western astrology domain. All query params optional, defaults to today at noon UTC.
"""
import os
from roxy_sdk import create_roxy
roxy = create_roxy(os.environ["ROXY_API_KEY"])
def main():
# Current moon phase driven by lunar position. Pass date= and timezone= for a specific day.
moon = roxy.astrology.get_current_moon_phase()
print("Date:", moon["date"])
print("Phase:", moon["phase"])
print("Illumination:", moon["illumination"], "%")
print("Lunar age:", moon["age"], "days")
print("Sign:", moon["sign"])
print("Degree:", moon["degree"])
print("Distance:", moon["distance"], "km")
meaning = moon.get("meaning")
if meaning:
print()
print("Symbol:", meaning["symbol"])
print("Energy:", meaning["energy"])
print("Keywords:", ", ".join(meaning["keywords"]))
print("Meaning:", meaning["description"])
if __name__ == "__main__":
main()