The Cycling Weather Forecast is a Python-based project designed to provide weather forecasts for bike training sessions. It fetches weather data from an API and processes it to determine the time of day and the percentage of rainfall. This information is then formatted into an email and sent to the user, providing them with a convenient and personalized weather forecast for their training sessions.
The project is developed using Python and utilizes several libraries and frameworks including:
os
for interacting with the operating systemdatetime
for handling date and time datasmtplib
andemail.mime
for sending emailsselenium
for automating web browser interactiondotenv
for managing environment variablespandas
for data manipulation and analysis
During the development of this project, several challenges were overcome and new skills were acquired. Working with APIs to fetch and process data provided valuable experience in handling JSON data and understanding how APIs work. Additionally, automating the process of sending emails with Python was a challenging but rewarding task that required a deep understanding of the SMTP protocol and MIME standards.
To use this project, follow these steps:
- Clone the repository to your local machine.
- Install the required Python libraries by running
pip install -r requirements.txt
. - Set up your environment variables in a
.env
file. You will need to specify your latitude, longitude, and email credentials. - Run the main script with
python src/main.py
.