updating latest from mac
This commit is contained in:
13
weather-cli/src/weather_cli/__init__.py
Normal file
13
weather-cli/src/weather_cli/__init__.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from .__version__ import __version__ # noqa
|
||||
import requests
|
||||
|
||||
|
||||
def current_weather(location, api_key):
|
||||
url = 'https://api.openweathermap.org/data/2.5/weather'
|
||||
|
||||
query_params = {
|
||||
'q': location,
|
||||
'appid': api_key,
|
||||
}
|
||||
response = requests.get(url, params=query_params)
|
||||
return response.json()['weather'][0]['description']
|
||||
Reference in New Issue
Block a user