Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations.
from pysolar.solar import *
import datetime
date = datetime.datetime.now()
print(get_altitude(42.206, -71.382, date))
date = datetime.datetime(2007, 2, 18, 15, 13, 1, 130320, tzinfo=datetime.timezone.utc)
print(get_altitude(42.206, -71.382, date))
Throws the following exception:
Traceback (most recent call last):
File "main.py", line 6, in <module>
print(get_altitude(42.206, -71.382, date))
File "/usr/local/lib/python2.7/site-packages/pysolar/tzinfo_check.py", line 77, in func_with_check
full = inspect.getfullargspec(func)
AttributeError: 'module' object has no attribute 'getfullargspec'
The example code from the documentation:
Throws the following exception:
Python 2.7.15