Weather prediction module Currently only obtaining samples from OpenWeatherMap
Two main scripts are in use:
cityMap.py can be used to extract a list of cities within a region from a json file containin all cities in OpenWeatherMap getweather.py is the main script managing weather requests and data storage on a local mongo database.
Set up:
-
Clone the repo.
-
Create account in https://openweathermap.org/.
-
Generate API key in https://home.openweathermap.org/api_keys.
-
Copy API key and set it up as environment variable:
export OWM_API_KEY="your_API_key"
-
(if you want, set this up in .bashrc, so the variable is set for the log in session)
-
Get telegram bot id and chat id, export them as well:
export BOT_CLIENT="bot_id"
export BOT_CHATID="bot_chat_id"
-
Download city list from http://bulk.openweathermap.org/sample/
-
Run CityMap.py giving the directory of the city list. This set up the cities where the samples will be taken.
-
Run getweather.py to get a sample on the defined cities.