A sleek Weather CLI Application using Python and OpenWeatherMap API.
Built with real-time weather updates, search history,.envsupport — great for beginners & API learners!
- 🌤️ Real-time weather data by city name
- 🌡️ Temperature in Celsius (converted from Kelvin)
- ✅ API integration using
.envfile - 📝 Saves search history (last 10 entries)
- 📂 Creates
history.txtautomatically ⚠️ Error handling for wrong cities & network issues- 🧠 Beginner-friendly, modular, secure
git clone https://github.com/Rumaisas-islam/weather-cli-app.git
cd weather-cli-apppip install requests python-dotenvAPI_KEY=your_openweathermap_api_key_here❗ Don’t share this file — it's already excluded by
.gitignore.
python weather_app.pyweather-cli-app/
├── weather_app.py # Main Python script
├── .env # Contains your API key (excluded from Git)
├── .env.example # Sample template
├── history.txt # Created automatically on first run
├── .gitignore
├── LICENSE
├── README.md
└── test/
└── test_weather_app.py (optional)
--- Weather CLI App ---
1. Check Weather
2. View Search History
3. Exit
Enter your choice (1-3): 1
Enter city name: Karachi
🌤️ Weather in Karachi at 2025-07-09 06:55:53
Temperature: 28.33°C
Condition: Scattered Clouds
- Python 3.x
- OpenWeatherMap API
requests,python-dotenv- File Handling
- Command Line Interface
- Add ASCII/emoji icons for weather
- Weekly forecasts
- Export to CSV/JSON
- Add color styling with
colorama - GUI version using Tkinter
Licensed under the MIT License — see the LICENSE file.
If this helped you, give the repo a ⭐ and share with others! PRs and contributions are warmly welcome.
#python #weather-api #cli-app #openweathermap #file-handling #api-integration #beginner-project
