A simple Weather API App retrieve and display real-time weather information by city name.
- Clone the Repository
git clone https://github.com/yuutoa/weather-api-app.git
cd weather-api-app
- Create and Activate a Virtual Environment
python -m venv env
# For Windows
.\env\Scripts\activate
# For Linux/Mac
source env/bin/activate
- Install Dependencies
pip install -r requirements.txt
-
Create an Account and Get API Key
- Visit OpenWeatherMap API and create a free account.
- Generate an API key.
-
Add API Key to
weather_app.py
- Open
weather_app.py
and go to line 120. - Replace the line with your API key:
- Open
api_key = 'your_key'
- Run the Program
python weather_app.py
- Search for Cities
- Enter city name to get weather information displayed instantly.