Skip to content

Instantly share code, notes, and snippets.

@saulcosta
Created February 6, 2019 03:25
Show Gist options
  • Save saulcosta/2884d0222b38f073b622d53c5e1d323e to your computer and use it in GitHub Desktop.
Save saulcosta/2884d0222b38f073b622d53c5e1d323e to your computer and use it in GitHub Desktop.
PyOWM example 4
import pyowm
owm = pyowm.OWM('<api_key>') # TODO: Replace <api_key> with your API key
boston = owm.weather_at_place('Boston, US')
weather = boston.get_weather()
print(weather.get_sunrise_time(timeformat='iso')) # Prints time in GMT timezone
print(weather.get_sunset_time(timeformat='iso')) # Prints time in GMT timezone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment