This is a Python-based application designed to provide real-time weather information for any specified city. Utilizing the OpenWeatherMap API, it displays current weather details such as temperature, weather conditions, humidity, UV index, and more. Additionally, the application now supports a 3-day UV index forecast, retrieved using the WeatherAPI.com service. This user-friendly application can be tailored for various global locations.
- Fetches and displays current weather data including temperature, weather description, humidity, UV index, etc.
- Provides a 3-day weather and UV index forecast.
- Easy to use with command line arguments for city selection.
- Real-time data retrieval from OpenWeatherMap API and WeatherAPI.com for UV forecasts.
- Python 3.12.0
- pip 23.2.1
Ensure you have the correct versions of Python and pip installed. Download Python here which includes pip.
To check your Python version:
python3 --version
To check your pip version:
pip3 --version
- Clone the repository.
- Navigate to the project's root directory.
- Setup your
.env
file in the root directory. Add your OpenWeatherMap and WeatherAPI.com API keys in this format:OMW_API_KEY=your_openweathermap_api_key UV_API_KEY=your_weatherapi_api_key
- Navigate to the project's root directory.
- Run the following command to install all required dependencies:
pip3 install -r requirements.txt
- Navigate to the project's root directory.
- Run the following command to execute the application:
python3 main.py
After starting the application, you will be prompted for the following inputs:
- City Name: Enter the name of the city for which you want to fetch weather data.
- Data Choice: Enter
1
to fetch the current weather or2
for the 3-day forecast. - Next Step: After displaying the data, choose whether to enter a new city, reuse the same city for different data, or quit.
This project was developed by yumeangelica. For more information on how this work can be used, please refer to the LICENSE.txt file.
Copyright © 2024 - present; yumeangelica
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. For more information, see the LICENSE file in this repository.