This simple Python script sends email alerts when rain is forecasted using the OpenWeatherMap API. If rain is detected in the forecast, an email notification is sent to a specified recipient.
- Fetches weather data using the OpenWeatherMap API.
- Sends an email alert if rain is forecasted.
- Configurable for different locations by setting latitude and longitude.
- Python 3.
- OpenWeatherMap API key.
- Email account with app-specific password enabled.
-
Set the latitude and longitude: Modify the parameters dictionary in the script to set your desired location.
-
Run the script: Execute the script to check the weather forecast and send an alert if rain is predicted.
If rain is forecasted, the script sends an email notification to the specified recipient. If no rain is forecasted, no email is sent.
Check this reel out: https://www.instagram.com/reel/C2ytSo_gh38/?igsh=dTUwam9mbno5YnF0