Primer commit con datos
This commit is contained in:
13
services/weather.py
Normal file
13
services/weather.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import requests
|
||||
|
||||
url = "https://api.openweathermap.org/data/2.5/weather/"
|
||||
|
||||
def get(city, key):
|
||||
data = {
|
||||
'q': city,
|
||||
'appid': key,
|
||||
'units': 'metric',
|
||||
}
|
||||
response = requests.get(url, params=data)
|
||||
return response.json()
|
||||
|
||||
Reference in New Issue
Block a user