Initial upload

This commit is contained in:
Mueez Khan 2021-03-25 08:58:09 -04:00 committed by GitHub
commit bf8a8f965d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 77 additions and 0 deletions

12
weather_request.py Normal file
View file

@ -0,0 +1,12 @@
import os
import requests
from pprint import pprint
from decouple import config
key = config('WEATHER_API_KEY')
city = input("Enter a city: ")
base_url = f"http://api.openweathermap.org/data/2.5/weather?appid={key}&q={city}"
weather_data = requests.get(base_url).json()
# pprint(weather_data)
print(weather_data['weather'][0]['description'])