Ferrxni commited on
Commit
904105c
1 Parent(s): c03a978

update api weather

Browse files
Files changed (1) hide show
  1. weather.py +8 -2
weather.py CHANGED
@@ -3,9 +3,15 @@ import json
3
  import datetime
4
  from pprint import pprint
5
  from datetime import date
 
 
 
 
 
 
6
  def get_weather(city, date):
7
- agro_api_key = "88aaa872e29fedb008a2ffd240ebdf56"
8
- opencage_api_key = "bade196e8eac4d33b72dba6d9e40285a"
9
 
10
  # On récupère les lat et lon de la ville
11
  geocode_url = f"https://api.opencagedata.com/geocode/v1/json?q={city}&key={opencage_api_key}"
 
3
  import datetime
4
  from pprint import pprint
5
  from datetime import date
6
+ from dotenv import load_dotenv
7
+ import os
8
+
9
+ load_dotenv()
10
+
11
+
12
  def get_weather(city, date):
13
+ agro_api_key = os.getenv("AGRO_API_KEY")
14
+ opencage_api_key = os.getenv("OPENCAGE_API_KEY")
15
 
16
  # On récupère les lat et lon de la ville
17
  geocode_url = f"https://api.opencagedata.com/geocode/v1/json?q={city}&key={opencage_api_key}"