Skip to main content

Sunrise Sunset is a simple tool for getting the sunrise and sunset times. It returns the sunrise and sunset times for a given location and date.

Project description

Sunrise Sunset API

Sunrise Sunset is a simple tool for getting the sunrise and sunset times. It returns the sunrise and sunset times for a given location and date.

Build Status Code Climate Prod Ready

This is a Python API Wrapper for the Sunrise Sunset API


Installation

pip install apiverve-sunrisesunset

Configuration

Before using the sunrisesunset API client, you have to setup your account and obtain your API Key.
You can get it by signing up at https://apiverve.com


Usage

The Sunrise Sunset API documentation is found here: https://docs.apiverve.com/api/sunrisesunset.
You can find parameters, example responses, and status codes documented here.

Setup

# Import the client module
from apiverve_sunrisesunset.apiClient import SunrisesunsetAPIClient

# Initialize the client with your APIVerve API key
api = SunrisesunsetAPIClient("[YOUR_API_KEY]")

Perform Request

Using the API client, you can perform requests to the API.

Define Query
query = { "lat": 36.7201600,  "lon": -4.4203400,  "date": "05-26-2024" }
Simple Request
# Make a request to the API
result = api.execute(query)

# Print the result
print(result)
Example Response
{
  "status": "ok",
  "error": null,
  "data": {
    "solarNoon": "2024-05-15T12:15:25.531Z",
    "nadir": "2024-05-15T00:15:25.531Z",
    "sunrise": "2024-05-15T05:11:29.338Z",
    "sunset": "2024-05-15T19:19:21.723Z",
    "sunriseEnd": "2024-05-15T05:14:24.538Z",
    "sunsetStart": "2024-05-15T19:16:26.523Z",
    "dawn": "2024-05-15T04:42:35.513Z",
    "dusk": "2024-05-15T19:48:15.548Z",
    "nauticalDawn": "2024-05-15T04:07:16.944Z",
    "nauticalDusk": "2024-05-15T20:23:34.117Z",
    "nightEnd": "2024-05-15T03:29:03.56Z",
    "night": "2024-05-15T21:01:47.501Z",
    "goldenHourEnd": "2024-05-15T05:48:14.811Z",
    "goldenHour": "2024-05-15T18:42:36.25Z"
  }
}

Customer Support

Need any assistance? Get in touch with Customer Support.


Updates

Stay up to date by following @apiverveHQ on Twitter.


Legal

All usage of the APIVerve website, API, and services is subject to the APIVerve Terms of Service and all legal documents and agreements.


License

Licensed under the The MIT License (MIT)

Copyright (©) 2024 APIVerve, and Evlar LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Download files

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

Source Distribution

apiverve_sunrisesunset-1.0.11.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apiverve_sunrisesunset-1.0.11-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file apiverve_sunrisesunset-1.0.11.tar.gz.

File metadata

  • Download URL: apiverve_sunrisesunset-1.0.11.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for apiverve_sunrisesunset-1.0.11.tar.gz
Algorithm Hash digest
SHA256 2c2eb2ae71a9075a2858de5e449cd8b99356632c4b042a25fa23bc228bff339a
MD5 b75dab6d7496b2535dae79956b3809fa
BLAKE2b-256 4df5a91f01335cdad4270482fe9f480fd8a4417fd2bdb16d74d6a674eec5e07c

See more details on using hashes here.

File details

Details for the file apiverve_sunrisesunset-1.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for apiverve_sunrisesunset-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 f55e85a445d74ef3284e5fcaa10d9df176a4de730c3c0fb420a5f92cc12274bf
MD5 6b9815c1180daa43879cc3c6e64871ce
BLAKE2b-256 1298996389111638c121a01a29de175a6da5b0c4bbd89578b587cb5fcef63354

See more details on using hashes here.

Supported by

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