{"id":19483813,"url":"https://github.com/morgan-sell/weather-api","last_synced_at":"2026-05-09T07:02:37.022Z","repository":{"id":260184756,"uuid":"878985308","full_name":"Morgan-Sell/weather-api","owner":"Morgan-Sell","description":"An application that fetches and returns weather data from a 3rd party API and caches results in Redis.","archived":false,"fork":false,"pushed_at":"2024-11-01T20:39:33.000Z","size":4530,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T05:03:52.151Z","etag":null,"topics":["api","ci","flask","html","pytest","python","redis","redis-cache","shell","webapp"],"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/Morgan-Sell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-26T16:42:03.000Z","updated_at":"2024-11-01T20:42:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc7de9c5-e5fc-4ccd-afc5-3adefc3140f4","html_url":"https://github.com/Morgan-Sell/weather-api","commit_stats":null,"previous_names":["morgan-sell/weather-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Morgan-Sell/weather-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morgan-Sell%2Fweather-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morgan-Sell%2Fweather-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morgan-Sell%2Fweather-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morgan-Sell%2Fweather-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Morgan-Sell","download_url":"https://codeload.github.com/Morgan-Sell/weather-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morgan-Sell%2Fweather-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32810381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","ci","flask","html","pytest","python","redis","redis-cache","shell","webapp"],"created_at":"2024-11-10T20:17:04.590Z","updated_at":"2026-05-09T07:02:36.988Z","avatar_url":"https://github.com/Morgan-Sell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather Application\n\nA Python-based application that checks the weather for a specified location. It first checks a Redis cache for recent data. If the weather data is not cached, the application fetches the data from a third-party weather API and caches the data for future requests. This reduces API calls, speeds up responses, and supports a better user experience.\n\nThe application obtains data from [Visiual Crossing's API](https://www.visualcrossing.com/weather-api).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Application Walkthrough](#application-walkthrough)\n- [Features](#features)\n- [Configuration](#configuration)\n- [Dependencies](#dependencies)\n- [Troubleshooting](#troubleshooting)\n- [License](#license)\n- [Acknowledgement](#acknowledgement)\n\n## Installation\n\n1. **Clone the Repository**\n   \n   ```\n   git clone https://github.com/Morgan-Sell/weather-api.git\n   cd weather-api\n   ```\n\n2. **Environment Variables:** Set up a .env file in the root directory of the project with the following variable.\n    \n    ```\n    API_KEY=\u003cyour_weather_api_key\u003e\n\n    ```\n\n3. **Run Initial Setup:** Use the provided run.sh script for setting up your environment.\n\n    ```\n    ./run.sh initial-setup\n    ```\n\n## Usage\n\n### Starting the Application\n\nTo start the application, run the following command:\n\n    ./run.sh run-app\n\nThis will:\n\n- Start a Redis server if it is not already running.\n- Load the environment variables.\n- Run the main application script located in `src/main.py`.\n\n## Application Walkthrough\n\n### 1. Launching the Application\nWhen you access http://127.0.0.1:5001 via your web browser, you'll be greeted by the home page.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./static/img/home.png\" alt=\"Home Page\"/\u003e\n\u003c/p\u003e\n\n### 2. Submit Location\nEnter the name of your desired city in the text box.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./static/img/submit.png\" alt=\"Submission\"/\u003e\n\u003c/p\u003e\n\n### 3. See the Results\nSelect \"Collect Weather Data\" and you will be directing to the current weather for your selected location.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./static/img/results.png\" alt=\"Results\"/\u003e\n\u003c/p\u003e\n\n### Available Commands\n\nYou can manage the environment and dependencies using `run.sh`:\n\n- **Run the application:** `./run.sh run-app`\n- **Set up virtual environment:** `./run.sh setup-venv`\n- **Install dependencies:** `./run.sh install-deps`\n- **Load environment variables:** `./run.sh load-env`\n\n## Features\n- **Weather Caching:** Checks for cached weather data in Redis before making API requests, reducing redundant calls and improving response times.\n- **Cross-Platform Support:** Works on Windows, macOS, and Linux.\n- **Easy Setup:** Simple bash script for environment setup, dependency installation, and application management.\n\n## Configuration\n- **Redis Configuration:** The application relies on Redis to cache weather data. The Redis server starts automatically through `run.sh run-app`, but you may need to ensure it is accessible and configured properly.\n\n- **Weather API Key:** Obtain an API key from Visiual Crossing and add it to the `.env` file.\n  \n    ```\n    API_KEY=\u003cyour_weather_api_key\u003e\n    ```\n\n## Dependencies\n\nAll the required dependencies can be found in `requirements.txt`. The dependencies are automatically installed when `run.sh initial-setup` is executed.\n\n## Troubleshooting\n\n- **Environment Variables:** Missing environment variables will prevent the application from running. Ensure they are correctly defined in your `.env` file.\n\n- **Redis Issues:** Redis will automatically start when `run.sh run-app`. If Redis is not properly terminated, the Redis process may enter a \"stopped\" or \"zombie\" state preventing the application from properly functioning. If this occurs follow these steps:\n\n1. Check if Redis is already running on your system.\n\n    ```\n    ps aux | grep redis\n    ```\nThis will show any existing Redis processes. Look for a process running on port 6379.\n\n1. If a Redis process is running, kill the process.\n\n    ```\n    sudo kill -9  \u003cpid\u003e\n    ```\nReplace \u003cpid\u003e with the process ID of the running Redis server.\n\n1.  Confirm the process has been terminated by rerunning: \n\n    ```\n    ps aux | grep redis\n    ```\n\n\n## License\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.\n\n## Acknowledgement\nThis application was built following the architecture outlined in [roadmap.sh's Weather API project](https://roadmap.sh/projects/weather-api-wrapper-service).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorgan-sell%2Fweather-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorgan-sell%2Fweather-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorgan-sell%2Fweather-api/lists"}