import requests
import time
from datetime import datetime, timedelta
import pandas as pd
# Aemet Opendata Request function
# Documentation: https://opendata.aemet.es/centrodedescargas/ejemProgramas?
def opendata_req(url, API_key):
querystring = {"api_key": API_key}
headers = {
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
data_url = response.json()
response = requests.get(data_url['datos'])
report = response.json()
return report
df
df
df_filtered = df.loc[df['Time'] == '22']
df_filtered ['Humidity']
Humidity_this_night = df_filtered.iloc[0,0]
message_this_night = "This night Humidity prevision is " + Humidity_this_night + " % at 22h\""
message_this_night
import os
os.putenv("MESSAGE", message_this_night)
!echo $MESSAGE
!cp -r /work /datasets/savetogoogledrive/Python/AemetHumidityDiaria
!find . -type f -iname \*.csv -delete