Weatherly is a simple weather forecast and rain alert web application. Users can enter a city name to get a 5-day weather forecast and check if rain is expected in that location.
- Weather Forecast: Provides a 5-day weather forecast for a specified city.
- Rain Alert: Notifies the user if rain is expected in the selected city, suggesting them to take an umbrella if needed.
- Text-to-Speech Alerts: Plays a verbal alert using text-to-speech functionality.
- Backend: Flask (Python)
- Frontend: HTML, CSS, JavaScript
- APIs:
- OpenWeatherMap for weather data
- Nominatim (OpenStreetMap) for geocoding
├── static/
│ ├── images/ # Stores images like the background and icons
│ └── style.css # Custom styles for the application
├── templates/
│ ├── home.html # Home page template
│ ├── index.html # Weather forecast page template
│ └── rain.html # Rain alert page template
├── app.py # Main Flask application
└── README.md # Project documentation
-
Clone the Repository:
git clone https://github.com/your-username/weatherly.git cd weatherly -
Install Dependencies: Make sure you have Python and pip installed. Install the required libraries:
pip install flask requests pygame gTTS
-
Set API Key: Replace the
API_KEYinapp.pywith your own OpenWeatherMap API key. -
Run the Application:
python app.py
-
Access the App: Open your browser and go to
http://127.0.0.1:5000.
-
Weather Forecast:
- Enter a city name in the text box and click "Get Forecast" to view a 5-day forecast.
-
Rain Alert:
- Enter the same city name and click "Check for Rain" to find out if rain is expected.
Ensure the following environment variable is set for your OpenWeatherMap API key:
OPENWEATHER_API_KEY='your_api_key_here'
You can update the CSS file (style.css) under static/ for further styling customization.
This project is licensed under the MIT License. See the LICENSE file for details.


