{"id":28719937,"url":"https://github.com/sboni2/weather_python","last_synced_at":"2026-04-19T05:35:15.187Z","repository":{"id":298249874,"uuid":"999343282","full_name":"sboni2/Weather_python","owner":"sboni2","description":" Weather App  A simple Python command-line tool that fetches and displays the current weather for any city using the OpenWeatherMap API. It shows:  🌤️ Main weather condition (e.g., Clear, Clouds)  🌡️ Temperature in Celsius  💧 Humidity percentage  You input a city name, and the script handles fetching and presenting the data","archived":false,"fork":false,"pushed_at":"2025-06-10T05:54:06.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-10T06:32:30.258Z","etag":null,"topics":["json","os","python3","requests","weather-app"],"latest_commit_sha":null,"homepage":"https://github.com/sboni2/Weather_python.git","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sboni2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-10T05:41:22.000Z","updated_at":"2025-06-10T05:56:55.000Z","dependencies_parsed_at":"2025-06-10T06:32:32.775Z","dependency_job_id":"21ac87fe-2c6e-4657-b796-e1611a64c516","html_url":"https://github.com/sboni2/Weather_python","commit_stats":null,"previous_names":["sboni2/weather_python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sboni2/Weather_python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboni2%2FWeather_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboni2%2FWeather_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboni2%2FWeather_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboni2%2FWeather_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sboni2","download_url":"https://codeload.github.com/sboni2/Weather_python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboni2%2FWeather_python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259929972,"owners_count":22933536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","os","python3","requests","weather-app"],"created_at":"2025-06-15T06:06:12.761Z","updated_at":"2026-04-19T05:35:15.138Z","avatar_url":"https://github.com/sboni2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ☁️ Weather App\n\nA simple **command-line Python tool** that fetches and displays real-time weather information for a user-specified location—using the OpenWeatherMap API.\n\n### 🌟 Features\n\n* **API Request**: Retrieves current weather data via HTTP requests using Python's `requests` library\n* **Real-time feedback**: Displays:\n\n  * Main weather condition (e.g., Clear, Clouds, Rain)\n  * Temperature in Celsius\n  * Humidity percentage\n* **User-friendly output**: Prints clean and informative messages based on API responses\n\n### 🔑 Key Concepts \u0026 Learning Goals\n\n1. **API Integration**\n   Connect to OpenWeatherMap with an API key passed through environment variables (`os.getenv`).\n\n2. **JSON Parsing**\n   Extract JSON data (temperature, humidity, weather description) from API responses ([realpython.com][1], [medium.com][2], [beapython.dev][3]).\n\n3. **Error \u0026 Status Handling**\n\n   * Check `status_code == 200` to confirm valid cities\n   * Inform user when a city is not found (404) or any request errors occur\n     ([medium.com][2])\n\n4. **Clean CLI Experience**\n   Prompt the user for input, then present readable, well-formatted weather output.\n\n---\n\n### ✅ Why This Project Matters\n\n* **Practical API use**: Demonstrates how to safely store and use API keys.\n* **Robust programming practices**: Handles different HTTP responses and user scenarios gracefully.\n* **Immediate utility**: A neat tool that delivers real-time, useful output for any location.\n* **Ideal for beginners**: Builds familiarity with `requests`, `json`, and error handling in a useful, real-world context.\n\n---\n\n### ⚙️ Quick Start\n\n1. Set your OpenWeatherMap API key:\n\n   ```bash\n   export weatherapp_api=\"YOUR_API_KEY\"\n   ```\n2. Run the script:\n\n   ```bash\n   python weather.py\n   ```\n3. Input a city when prompted, and get instant weather details!\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsboni2%2Fweather_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsboni2%2Fweather_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsboni2%2Fweather_python/lists"}