adding new files
This commit is contained in:
15
get_weather_data.py
Normal file
15
get_weather_data.py
Normal file
@ -0,0 +1,15 @@
|
||||
import os
|
||||
import requests
|
||||
from dotenv import load_dotenv
|
||||
|
||||
def main():
|
||||
load_dotenv('.env')
|
||||
apikey = os.environ.get("WEATHER_API_KEY")
|
||||
|
||||
url = f"https://my.meteoblue.com/packages/basic-1h_basic-day?apikey={apikey}&lat=47.517766&lon=8.995523&asl=475&format=json"
|
||||
response = requests.get(url)
|
||||
data = response.json()
|
||||
print(data)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user