Python wrapper for OpenWeather API
Project description
Sunnyside
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.currentWeather()
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.fiveDayForecast()
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")
Reference
https://openweathermap.org/api
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
sunnyside-1.0.2.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for sunnyside-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 857cb437771627dbf5a164424967e422f30d5556bd9350469c47d36abf929f6c |
|
MD5 | f49ede2053eb38d7887150639fc45c19 |
|
BLAKE2b-256 | c11ecfcdcdf03c5a31c97bb8f7cc8f6ce4b549d2aa7293929b8058552689e57c |