Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

☔ Automated Weather SMS Bot

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.

✨ Features

  • 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.

🛠️ Tech Stack

  • Language: Python 3
  • Libraries: requests, twilio, os
  • APIs: OpenWeatherMap API, Twilio SMS API
  • CI/CD / Automation: GitHub Actions

🚀 Local Setup and Testing

If you want to run this script on your local machine, follow these steps:

1. Prerequisites

You will need to create free accounts for the following services to get your API keys:

2. Install Dependencies

Clone this repository and install the required Python packages: pip install requests twilio

3. Configure Environment Variables

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 SID
  • TWILIO_AUTH_TOKEN = Your Twilio Auth Token
  • OWM_API_KEY = Your OpenWeather API Key

4. Run the Script

python main.py

☁️ Cloud Deployment (GitHub Actions)

This bot is designed to run automatically in the cloud. To set up your own daily trigger:

  1. Fork or upload this repository to a Private GitHub repository.
  2. Go to Settings > Secrets and variables > Actions.
  3. Add the three environment variables listed above as Repository Secrets.
  4. Create a workflow file at .github/workflows/main.yml using the provided YAML configuration.
  5. 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! 🚀

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages