Monday, May 4, 2020

Get weather data

Source:
https://www.freecodecamp.org/news/obtain-historical-weather-forecast-data-in-csv-format-using-python/


1. Sign up here
https://www.worldweatheronline.com/developer/signup.aspx


2. Get API_KEY



3. !pip install wwo_hist


4. Run for some dates and cities


from wwo_hist import retrieve_hist_data


frequency=24
start_date = '01-APR-2019'
end_date = '15-APR-2020'
api_key = '914b5f406fb34c4da0b131207200405'
#location_list = ['mecca','tabuk','al madinah','riyadh','asir','dammam']
location_list = ['al-madinah']

hist_weather_data = retrieve_hist_data(api_key,
                                location_list,
                                start_date,
                                end_date,
                                frequency,
                                location_label = False,
                                export_csv = True,
                                store_df = True)

No comments:

Post a Comment

Loud fan of desktop

 Upon restart the fan of the desktop got loud again. I cleaned the desktop from the dust but it was still loud (Lower than the first sound) ...