Skip to main content

Mini python wrapper for OpenWeather API's one call, current and forecast5 services.

Project description

Sunnyside

GitHub release Python Version

Installation

pip3 install sunnyside

Getting Started

Python Version

Sunnyside only supports python 3.6+


from sunnyside import Sunnyside

ref = Sunnyside("YOUR-API-KEY-HERE", "your-units-here") # Enter your api key here

Current Weather

https://openweathermap.org/current

Weather by city name

Note: Units are by default in Kelvin, to change units to imperial or celsius.

weather = ref.current_weather()
response = weather.get_current_weather_by_city_name("city_name") # Enter your city name here

Weather by city id

response = weather.get_current_weather_by_city_id("city_id")

Weather by coordinates

response = weather.get_current_weather_by_geo_coords("lat","lon")

Weather by zip code

response = weather.get_current_weather_by_zip_code("zipcode")

5 Day Weather Forecast

https://openweathermap.org/forecast5

Weather by city name

forecast = ref.five_day_forecast()
response = forecast.get_forecast_by_city_name("some_city_name_here")

Weather by city id

response = forecast.get_forecast_by_city_id("city_id")

Weather by coordinates

response = forecast.get_forecast_by_geo_coords("lat","lon")

Weather by zip code

response = forecast.get_forecast_by_zip_code("zipcode")

One Call

https://openweathermap.org/api/one-call-api

Get weather data from one call api

openweather = ref.one_call()
response = openweather.get_weather("33.441792","-94.037689")

Reference

https://openweathermap.org/api

https://openweathermap.org/current

https://openweathermap.org/forecast5

https://openweathermap.org/api/one-call-api

Project details


Download files

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

Files for sunnyside, version 2.0.0
Filename, size File type Python version Upload date Hashes
Filename, size sunnyside-2.0.0-py3-none-any.whl (4.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sunnyside-2.0.0.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page