Pysolar is a Python library for calculating the position of the sun relative to the earth as a function of latitude, longitude, and time. There is also code included for other problems related to the development of photovoltaic systems. Still in alpha.