moon/usage.py

23 lines
818 B
Python
Raw Permalink Normal View History

2024-08-28 19:46:13 +07:00
import moon
from datetime import datetime
country = "Indonesia"
city = "Jakarta"
phase = moon.phase(country.lower().replace(" ", "-"), city.lower().replace(" ", "-"))
hijri = moon.hijri()
print("================================================")
print(phase['image'])
print(phase['phase'], f"({phase['percent']})")
print("================================================")
print(hijri['day']['ar'], f"({hijri['day']['en']})")
print(hijri['day']['number'], hijri['month']['ar'], f"({hijri['month']['en']})", hijri['year'], hijri['notation']['en'])
print(f"{country}, {city}")
print("================================================")
print(datetime.now().strftime("%I:%M:%S %p"))
print("================================================")
# Not support a day changing on sunset (Maghrib)
# NEXT: Prayer times