Skip to main content

Sundowner

https://travis-ci.org/kenners/sundowner.svg?branch=master

Sundowner is a Python3 Flask application that provides an API to return JSON objects containing Javascript timestamps of civil dawn, civil dusk, sunrise, and sunset.

It also provides a simple web app that uses this API.

Sundowner uses PyEphem to calculate astronomical parameters.

Sunrise and sunset times are calculated according to the United States Naval Observatory specifications, whereby for dawn and dusk, atmospheric refraction is estimated by setting observer pressure to zero and the horizon to 34 arcminutes below the normal horizon.

Civil dawn and dusk are when the sun is 6º below the horizon.

Sundowner is licensed under the MIT License.

Dependencies

Sundowner has the following Python3 dependencies:

  • Flask 0.10

  • ephem 3.7

  • itsdangerous 0.24

  • Jinja2 2.7.2

  • MarkupSafe 0.23

  • Werkzeug 0.9.4

  • python-dateutil 2.2

URL endpoints

Sundowner exposes the following endpoint:

  • /api/sun

Parameters

  • <lat> and <lon> are simple decimals of latitude and longitude respectively, e.g. Rothera’s location is expressed as -67.57 and -68.13

  • <start> and <end> are start and end dates for the desired period, in ISO 8601 format (as produced by Javascript’s .toJSON() method)

  • <output_type> is an optional parameter for the resulting datetimes, defaulting to iso for ISO 8601 format. Alternatively, use js for Javascript timestamp, or dt for a human-readable datetime.

Output

The API returns a JSON object, as follows:

{
  "days": [
    {
      "date": "2014-05-23",
      "events": {
        "civil_dawn": "2014-05-23T12:58:31.819853+00:00",
        "civil_dusk": "2014-05-23T19:59:14.923174+00:00",
        "sunrise": "2014-05-23T14:31:56.000752+00:00",
        "sunset": "2014-05-23T18:25:53.468033+00:00"
      }
    }
  ],
  "latlon": {
    "lat": "-67.57",
    "lon": "-68.13"
  }
}

Acknowledgements

Sundowner uses the following components:

Full-text copies of the above licenses may be found at:

Metadata

Release files for Sundowner 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Sundowner 0.2
File Size Uploaded Provenance Actions
Sundowner-0.2.tar.gz 969.1 kB Without provenance Details for Sundowner-0.2.tar.gz

Release files / Sundowner-0.2.tar.gz

Download URL Sundowner-0.2.tar.gz
Size 969.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2ff61b04d0bed3c20627e4f87b931959d25d73da5baa9664206a5116015917c4
BLAKE2b-256 checksum
How to use checksums
fdbb4f415009c3b9a65ac004d68b0efc1342b8f8766486298677ca990c3d5bb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Sundowner 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

0.1.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page