This project sends an SMS alert to the user in the event of bad weather, such as rain or snow for the following day.
To install the required packages from the command line, execute the following command as it contains all the packages that have been used in the requirements.txt file.
pip install -r requirements.txt
Weather data through OpenWeatherMap API.
SMS Texts sent using the Twilio API.
- Create a OpenWeatherMap account
- Create an API Key and save to your
.env.text
file. - Use the
os
module to access your API key from the.env.text
file. - Create a Twilio account
- Verify your account with your phone number.
- Create a twilio phone number from the console panel.
- From the console panel, copy and paste your account_sid and your authentication token to your
.env
with variable names ofACC_SID
andAUTH_TOKEN
and retrieve the values using theos
module in yourmain.py
.
- Use latlong.net to get your latitude and longitude of your city,
then edit the
LAT, LONG
variables inmain.py
with your latitude and longitude data.
You can bypass the use of environment variables in this project and assign your personal details as string values if you only intend to use the project on your local machine. However, it's important to be aware of the risks of publishing your personal details on the internet.
You can use PythonAnyWhere to schedule a task that runs every day on specific hour.
I appreciate you taking the time to read and view this project. Please take care and stay safe.