Skip to main content

Calculations for solar time such as dawn, sunrise, sunset, dusk.

Project description

This is ‘solartime’, a Python module which calculates times for various positions of the sun: dawn, sunrise, solar noon, sunset, and dusk.

‘solartime’ is a vastly-simplified fork of Simon Kennedy’s ‘astral’ module, and is Free / Libre Open Source software under the Apache 2.0 license.

Its only dependency is the pytz package, and Python 2.6, 2.7, 3.3+.

Example usage:

>>> from datetime import date
>>> from pytz import timezone
>>> from solartime import SolarTime
>>>
>>> today = date(2014, 4, 20)
>>> localtz = timezone('US/Eastern')
>>> lat, lon = 38.0, -79.0
>>>
>>> sun = SolarTime()
>>> schedule = sun.sun_utc(today, lat, lon)
>>> sunset = schedule['sunset'].astimezone(localtz)
>>> print sunset
2014-04-20 19:56:38-04:00

License

Copyright 2015 David A. Riggs <driggs@myotisoft.com> Copyright 2009-2014 Simon Kennedy <sffjunkie+code@gmail.com>

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solartime-0.1b1.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file solartime-0.1b1.tar.gz.

File metadata

  • Download URL: solartime-0.1b1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for solartime-0.1b1.tar.gz
Algorithm Hash digest
SHA256 ba7075d502ff32efd0644028dfc1c54e06ccf88fb6634b2038ab148ff37826e5
MD5 f95da429925bf9d063cb7a15fde158d5
BLAKE2b-256 de1117952e2e49caad49fc372ba1ae20b9abedb94f238f67623f83e35e7c0700

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page