This Python project provides a rain alert system that notifies users about upcoming rain based on predefined settings and a chosen location by sending SMS messages. It aims to save time for individuals, especially those residing in Vancouver ☔. With this rain alert system, users no longer need to manually check the weather each morning before heading to work. The system automates the process by providing timely notifications about rain forecasts, ensuring users stay informed without the need for manual weather checks.
Remember to give a if you found this helpful!
The rain alert system is built using Python and utilizes weather data from an API to send notifications when rain is forecasted for a specified location. The core functionalities of the project include:
- Fetching weather data for a specified location.
- Analyzing the weather forecast to detect rain.
- Sending alerts to users through SMS by using Twilio API.
Ensure you have Python installed on your machine. If not, you can download and install Python from the official Python website.
- Clone the repository:
git clone https://github.com/YuluDuan/rain-alert.git
- Install the required dependencies:
pip install -r requirements.txt
- Set up your API keys:
- Obtain API keys from OpenWeatherMap and set them in the configuration file.
- Obtain API tokens and Virtual phone number from Twilio
- Run the script:
cd rain_alert
python main.py
PythonAnywhere is a platform that allows you to run Python scripts in the cloud, making it a convenient option for automating tasks.
-
Sign Up/Log In: Sign up or log in to your PythonAnywhere account.
-
Upload Your Project: Upload your
rain_alert/main.py
project to PythonAnywhere -
Create a New Task:
- Go to the Dashboard and navigate to the "Tasks" tab.
- Click on "Create a new task."
- Select the Python version and set the task to run the
main.py
script. - Set run command to
export OWN_API_KEY=YOUR_OWN_API_KEY; export AUTH_TOKEN=YOUR_TWILIO_TOKEN; python3 main.py
- Set the Schedule:
- Set the desired schedule for the task to run periodically (Daily for this project).
- Save the task.
Contributions are welcome! If you'd like to contribute to this project, please follow the guidelines in CONTRIBUTING.md
.
This project is licensed under the MIT License - see the LICENSE
file for details.