| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A simple command-line app that fetches current weather for any city using the OpenWeatherMap API.
. ├── main.py # App entry point ├── api_key # Your OpenWeatherMap API key (plain text) ├── README.md └── LICENSE
Get an API key Sign up at openweathermap.org and grab a free API key.
Add your API key Paste your api key in the api_key file (no quotes, no extra whitespace):
your_api_key_here
Install dependencies
pip install requestsRun the app:
python main.pyYou'll be prompted to enter a city name:
Enter a city: London
========================================
WEATHER IN LONDON
========================================
🌡️ Temperature : 18.2°C
🤔 Feels Like : 17.9°C
💧 Humidity : 64%
💨 Wind Speed : 3.6 m/s
☁️ Condition : Scattered clouds
========================================
| Scenario | Message |
|---|---|
| Empty city input | Error: City name cannot be empty. |
| Invalid API key | Error: Invalid API key. |
| City not found | Error: City '<city>' was not found. |
| Request timeout | Error: Request timed out. |
| Connection failure | Error: Could not connect to the server. |
| Other HTTP errors | Error: Server returned status code <code>. |
See LICENSE for details.
| Back | FazBrowse Home | New Git URL |