Python code to calculate sunrise and sunset for a given lat/long and time - uses ephem module
python3.10 -m pip install ephem
Collecting ephem
Using cached ephem-4.1.3-cp310-cp310-macosx_10_9_x86_64.whl (1.4 MB)
Installing collected packages: ephem
Successfully installed ephem-4.1.3
python3.10 sunrise_sunset.py
07:58
15:54