A Python-based cloud automation script that checks the daily weather forecast for your specific location and sends an SMS alert to your phone if rain is expected. Perfect for making sure you never forget your umbrella!
This project is fully automated using GitHub Actions, running silently every morning without any manual intervention.
- Live Weather Data: Integrates with the OpenWeatherMap API to fetch a highly accurate 12-hour forecast.
- SMS Notifications: Utilizes the Twilio API to instantly deliver text messages to your verified device.
- Cloud Automation: Fully automated via a Cron job scheduled through GitHub Actions.
- Enterprise Security: Uses OS environment variables and GitHub Secrets to keep API keys and auth tokens completely hidden from the public repository.
- Language: Python 3
- Libraries:
requests,twilio,os - APIs: OpenWeatherMap API, Twilio SMS API
- CI/CD / Automation: GitHub Actions
If you want to run this script on your local machine, follow these steps:
You will need to create free accounts for the following services to get your API keys:
- OpenWeatherMap (for the
OWM_API_KEY) - Twilio (for the
TWILIO_ACCOUNT_SIDandTWILIO_AUTH_TOKEN)
Clone this repository and install the required Python packages:
pip install requests twilio
For security reasons, API keys are not hardcoded into the script. You must set them as environment variables on your local machine before running the script:
TWILIO_ACCOUNT_SID= Your Twilio Account SIDTWILIO_AUTH_TOKEN= Your Twilio Auth TokenOWM_API_KEY= Your OpenWeather API Key
python main.py
This bot is designed to run automatically in the cloud. To set up your own daily trigger:
- Fork or upload this repository to a Private GitHub repository.
- Go to Settings > Secrets and variables > Actions.
- Add the three environment variables listed above as Repository Secrets.
- Create a workflow file at
.github/workflows/main.ymlusing the provided YAML configuration. - The bot will now run automatically at the time specified in your Cron schedule (e.g., 6:00 AM IST)!
Created as part of the 100 Days of Code Python Bootcamp journey! 🚀