{"id":26482657,"url":"https://github.com/m-hammad-faisal/weather-app","last_synced_at":"2025-03-20T04:14:38.480Z","repository":{"id":243082456,"uuid":"811418299","full_name":"M-Hammad-Faisal/weather-app","owner":"M-Hammad-Faisal","description":"A Weather App: This repository contains two versions of a Weather App built with Python i.e, Console-based Weather App, and GUI-based Weather App (tkinter)","archived":false,"fork":false,"pushed_at":"2024-06-08T00:30:42.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-08T01:37:19.524Z","etag":null,"topics":["cli","cli-app","gui-application","openweathermap","openweathermap-api","python","python3","python312","tkinter","tkinter-gui","tkinter-python","weather-app"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/M-Hammad-Faisal.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-06-06T15:00:58.000Z","updated_at":"2024-06-08T00:30:45.000Z","dependencies_parsed_at":"2024-06-06T17:07:17.572Z","dependency_job_id":null,"html_url":"https://github.com/M-Hammad-Faisal/weather-app","commit_stats":null,"previous_names":["m-hammad-faisal/weather-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M-Hammad-Faisal%2Fweather-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M-Hammad-Faisal%2Fweather-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M-Hammad-Faisal%2Fweather-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M-Hammad-Faisal%2Fweather-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/M-Hammad-Faisal","download_url":"https://codeload.github.com/M-Hammad-Faisal/weather-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244547552,"owners_count":20470105,"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":["cli","cli-app","gui-application","openweathermap","openweathermap-api","python","python3","python312","tkinter","tkinter-gui","tkinter-python","weather-app"],"created_at":"2025-03-20T04:14:37.943Z","updated_at":"2025-03-20T04:14:38.472Z","avatar_url":"https://github.com/M-Hammad-Faisal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather App\n\nThis repository contains two versions of a Weather App built with Python:\n\n1. `Console-based Weather App`: A command-line interface (CLI) application.\n2. `GUI-based Weather App`: A graphical user interface (GUI) application using Tkinter.\n\nBoth versions fetch and display weather information for a given location using the `OpenWeatherMap` API.\n\n## Features\n\n- Fetches current weather data for a specified location.\n- Displays temperature, humidity, weather description, wind speed, cloudiness, sunrise, and sunset times.\n- Simple and user-friendly interface for both CLI and GUI.\n\n## Prerequisites\n\n- `Python 3.12` installed on your machine.\n- An `API key` from OpenWeatherMap. You can get it [here](https://home.openweathermap.org/users/sign_up).\n\n## Installation\n\n1. Clone the repository or download the code:\n   ```bash\n   git clone https://github.com/m-hammad-faisal/weather-app.git\n   cd weather-app\n   ```\n2. Install the required Python packages:\n    ```bash\n   pip install -r requirements.txt\n    ```\n3. Make sure you have Tkinter installed. Tkinter is included with the standard Python distribution. If you encounter issues, you can install it via your package manager:\n    - On Debian-based Linux distributions (like `Ubuntu`):\n      ```bash\n      sudo apt-get install python3-tk\n      ```\n    - On `macOS`:\n      ```bash\n      brew install python-tk\n      ```\n4. Replace `YOUR_API_KEY` in the code with your actual API key from OpenWeatherMap in both the console and GUI versions.\n\n## CLI Weather App\n### Usage\nOpen cloned repository in terminal and run the script:\n   ```bash\n   python -m weather_app_cli.weather_app\n   ```\n\nFollow the prompts to enter a location and receive the weather information.\n\n### Code Overview\n- `weather_app.py`: The main script for the console application.\n#### Example\n   ```text\n   Enter a location (or 'exit' to quit): Lahore\n   \n    Weather in Lahore, PK (Longitude: 74.3436, Latitude: 31.5497):\n        Weather: Haze\n        Detail: haze\n        \n        Temperature: 35.99°C   (Feels like: 36.15°C)\n        Min Temperature: 35.99°C\n        Max Temperature: 36.72°C\n        \n        Pressure: 1004 hPa\n        Humidity: 30%\n    \n        Visibility: 4000 meters\n        Cloudiness: 40%\n        \n        Wind Speed: 4.12 m/s\n        Wind Direction: 270°\n        \n        Sunrise: 2024-06-06 04:57:38\n        Sunset: 2024-06-06 19:05:19\n   ```\n\n## GUI Weather App\n### Usage\nOpen cloned repository in terminal and run the script:\n   ```bash\n   python -m weather_app_gui.weather_app\n   ```\nA window will appear prompting you to enter a location. Enter the name of the city or location and click \"Get Weather\". The weather information will be displayed in the window.\n\n### Code Overview\n- `weather_app.py`: The main script that creates and runs the Tkinter GUI.\n- The GUI is designed and managed within a `WeatherApp` class to avoid the use of global variables and to keep the code organized.\n\n### Main Functions\n- `__init__(self, root)`: Initializes the GUI components.\n- `get_weather(self)`: Fetches and displays the weather information for the entered location.\n\n## Common Helper Functions\n- `fetch_weather(api_key, location)`: Makes an API call to OpenWeatherMap and returns the weather data.\n- `format_weather_data(data)`: Formats the fetched weather data for display.\n\n## Contributing\nContributions are welcome! Please fork this repository and submit pull requests for any features or improvements.\n\n## License\nThis project is licensed under the `MIT License`. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-hammad-faisal%2Fweather-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-hammad-faisal%2Fweather-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-hammad-faisal%2Fweather-app/lists"}