Skip to content
Permalink
196c1205be
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
18 lines (13 sloc) 738 Bytes
# Made by Andris Jansons
import pyowm # (In case of errors) pip install pyowm
owm = pyowm.OWM('de3ca9ba44d7bc37ce1279f34c3a0911') # You get this at OpenWeatherMap
def weatherFinder(location):
"""For a specific location get weather data"""
observation = owm.weather_at_place(location)
w = observation.get_weather()
# Weather details
desc = w.get_detailed_status() # e.g. few clouds
wind = w.get_wind().get('speed') # dictionary type
humidity = w.get_humidity() # e.g. 98
temperature = w.get_temperature('celsius').get('temp') # {'temp_max': 10.5, 'temp': 9.7, 'temp_min': 9.0}
return desc, str(temperature), str(wind), str(humidity)