A simple command-line weather application built with Python that fetches real-time weather data from the OpenWeatherMap API. You can input any city name and instantly get the weather condition, temperature, date, and other useful info.
-
Get real-time weather for any city
-
Displays:
- Current date
- Weather status (Clear, Clouds, Rain, etc.)
- Temperature (Β°F or Β°C, based on your code)
-
Simple, lightweight, and beginner-friendly
-
Uses the
requestslibrary -
Runs inside a Python virtual environment
Enter city: Los Angeles
Date: Monday, November 24, 2025
The weather in Los Angeles is: Clear
The temperature in Los Angeles is: 59Β°F
git clone https://github.com/wayphantomme/python-weather-app.git
cd python-weather-app
python3 -m venv .venv
source .venv/bin/activate
pip install requests
This project uses the OpenWeatherMap API.
- Go to https://openweathermap.org/api
- Create a free account
- Get your API key
- Open
app.pyand replace:
api_key = "YOUR_API_KEY_HERE"python app.py
Then enter any city name when prompted.
python-weather-app/
β
βββ app.py
βββ README.md
βββ .gitignore
- Do not upload
.venvto GitHub - Make sure your API key is not exposed in public repos
- If using this repo publicly, consider using environment variables
This project is free to use for learning and experimentation.