{"id":22140642,"url":"https://github.com/athlan/weather-microservice","last_synced_at":"2025-03-24T11:18:09.345Z","repository":{"id":25701256,"uuid":"29137708","full_name":"athlan/weather-microservice","owner":"athlan","description":"Python Weather microservice","archived":false,"fork":false,"pushed_at":"2015-01-19T08:33:09.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T16:26:08.120Z","etag":null,"topics":["microservice","weather","wunderground-api"],"latest_commit_sha":null,"homepage":null,"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/athlan.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}},"created_at":"2015-01-12T13:54:39.000Z","updated_at":"2017-08-12T10:18:11.000Z","dependencies_parsed_at":"2022-08-23T10:30:53.385Z","dependency_job_id":null,"html_url":"https://github.com/athlan/weather-microservice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athlan%2Fweather-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athlan%2Fweather-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athlan%2Fweather-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athlan%2Fweather-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athlan","download_url":"https://codeload.github.com/athlan/weather-microservice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245258215,"owners_count":20585977,"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":["microservice","weather","wunderground-api"],"created_at":"2024-12-01T21:06:49.832Z","updated_at":"2025-03-24T11:18:09.324Z","avatar_url":"https://github.com/athlan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Weather Microservice\r\n====================\r\n\r\nThis is simple microservice that provides information about weather.\r\n\r\nAuthor: Piotr Pelczar\r\n\r\nWeather microservice starts web server and provide weather conditions data as JSON API for selected location using Wunderground API. Results are cached into Redis key-value database.\r\n\r\nFuthermore there is a guard level that \r\n\r\nData is fetched from abstraction layer called Repository, and there are 3 implementations of Weather Respository:\r\n* `Wunderground` - base repository fetching data directly from Wunderground API.\r\n* `WundergroundApiLimitGuard` - repository proxy prevents calling API more times than is allowed by limits.\r\n* `Cached` - each request is cached locally.\r\n\r\nThe app is based on Flask REST frmework utilizing Dependency Injection known from Spring (Spring Python), named instances of classes are declared in `app-context.yml`.\r\n\r\nUsed libraries:\r\n* Flask\r\n* Flask REST\r\n* spring-python for Dependency Injection\r\n* PyYAML\r\n* Redis\r\n\r\n# API\r\n\r\n# Setup\r\n\r\n## Requirements:\r\n\r\n* Python 2.7\r\n* virtualenv\r\n\r\n## Installation:\r\n\r\n* Create virtualenv\r\n```\r\n$ virtualenv env\r\n$ source env/bin/activate\r\n```\r\n* Install dependencies\r\n```\r\npip install -r requirements.txt\r\n```\r\n* You are ready!\r\n\r\nTo deactivate virtualenv just type:\r\n```\r\n$ deactivate\r\n```\r\n\r\n## Run app:\r\n\r\n```\r\npython app.py\r\n```\r\nor\r\n```\r\npython app.py [-h \u003chost=0.0.0.0\u003e] [-p \u003cport=5000\u003e] [-e \u003cenv=prod|dev\u003e]\r\n```\r\n\r\nMake request:\r\n```\r\ncurl http://localhost:5000/api/v1.0/weather/conditions/CA/San_Francisco\r\n```\r\n\r\n## Configuration\r\n\r\n* config/parameters.yml (copy from config/parameters.yml.dist first)\r\n* config/app-context.yml (set cache TTL)\r\n\r\n## References\r\n\r\n* http://docs.spring.io/spring-python/1.2.x/sphinx/html/objects-yamlconfig.html\r\n* http://www.rafekettler.com/magicmethods.html\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathlan%2Fweather-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathlan%2Fweather-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathlan%2Fweather-microservice/lists"}