In [6]:
import pyowm

In [7]:
owm = pyowm.OWM('1625dc2505f770bd77be9faa382dad78')

In [ ]:
# Will it be sunny tomorrow at this time in Milan (Italy) ?
forecast = owm.daily_forecast('berlin,de')
tomorrow = pyowm.timeutils.tomorrow()
forecast.will_be_sunny_at(tomorrow)  # Always True in Italy, right? ;-)

In [14]:
# Search for current weather in London (UK)
observation = owm.weather_at_place('berlin,de')
w = observation.get_weather()
print(w)                      # <Weather - reference time=2013-12-18 09:20, 
                              # status=Clouds>


<pyowm.webapi25.weather.Weather - reference time=2015-05-20 19:15:48+00, status=clouds>

In [15]:
# Weather details
w.get_wind()                  # {'speed': 4.6, 'deg': 330}
w.get_humidity()              # 87
w.get_temperature('celsius')  # {'temp_max': 10.5, 'temp': 9.7, 'temp_min': 9.0}


Out[15]:
{'temp': 12.17, 'temp_kf': None, 'temp_max': 12.17, 'temp_min': 12.17}

In [13]:
# Search current weather observations in the surroundings of 
# lat=22.57W, lon=43.12S (Rio de Janeiro, BR)
observation_list = owm.weather_around_coords(-22.57, -43.12)

In [16]:
observation.get_reception_time()


Out[16]:
1432149693

In [22]:
observation.get_reception_time(timeformat='iso')


Out[22]:
'2015-05-20 19:27:52+00'

In [21]:
observation = owm.weather_at_place('berlin,de')

In [26]:
times = []
for _ in range(10):
    observation = owm.weather_at_place('berlin,de')
    t = observation.get_reception_time()
    times.append(t)

In [27]:
times


Out[27]:
[1432150477,
 1432150477,
 1432150477,
 1432150478,
 1432150478,
 1432150478,
 1432150478,
 1432150478,
 1432150478,
 1432150478]

In [ ]: