{"id":34095748,"url":"https://github.com/devmatteini/forecastpy","last_synced_at":"2026-04-09T04:32:19.819Z","repository":{"id":52312024,"uuid":"187684565","full_name":"devmatteini/forecastpy","owner":"devmatteini","description":"A python package to interact with the OpenWeatherAPI in a simple and fast way.","archived":false,"fork":false,"pushed_at":"2022-12-08T05:13:14.000Z","size":48,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-16T19:13:57.802Z","etag":null,"topics":["forecast","openweathermap-api","python","weather"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devmatteini.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}},"created_at":"2019-05-20T17:24:42.000Z","updated_at":"2019-09-01T22:45:09.000Z","dependencies_parsed_at":"2023-01-24T11:40:20.465Z","dependency_job_id":null,"html_url":"https://github.com/devmatteini/forecastpy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devmatteini/forecastpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmatteini%2Fforecastpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmatteini%2Fforecastpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmatteini%2Fforecastpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmatteini%2Fforecastpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devmatteini","download_url":"https://codeload.github.com/devmatteini/forecastpy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmatteini%2Fforecastpy/sbom","scorecard":{"id":337929,"data":{"date":"2025-08-11","repo":{"name":"github.com/devmatteini/forecastpy","commit":"d0eda930256524ee2a3c6dfe0e64394c006d9975"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: PYSEC-2020-149 / GHSA-hmv2-79q8-fv6g","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2020-148 / GHSA-wqvq-5m8c-6g24","Warn: Project is vulnerable to: PYSEC-2021-108"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T05:10:19.521Z","repository_id":52312024,"created_at":"2025-08-18T05:10:19.521Z","updated_at":"2025-08-18T05:10:19.521Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31586403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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":["forecast","openweathermap-api","python","weather"],"created_at":"2025-12-14T15:19:07.848Z","updated_at":"2026-04-09T04:32:19.813Z","avatar_url":"https://github.com/devmatteini.png","language":"Python","readme":"# ForecastPy\r\n\r\nA python package to interact with the OpenWeatherAPI in a simple and fast way.\r\n\r\n[Live demo](https://devmc.pythonanywhere.com) here.\r\n\r\n## Table of Contents\r\n\r\n- [Getting Started](#getting-started)\r\n  - [Installation](#installation)\r\n  - [Usage](#usage)\r\n- [Documentation](#documentation)\r\n  - [Dependencies](#dependencies)\r\n  - [Unit](#unit)\r\n  - [Days](#days)\r\n  - [Weather](#weather)\r\n  - [Errors](#errors)\r\n- [Built With](#built-With)\r\n- [Version](#version)\r\n- [Author](#author)\r\n- [Licence](#license)\r\n\r\n## Getting Started\r\n\r\n### Installation\r\n\r\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install ForecastPy.\r\n\r\n```\r\npip install forecastpy\r\n```\r\n\r\n### Usage\r\n\r\n```\r\nfrom forecastpy import Weather, Unit, Days\r\n\r\n# Init Weather object with your open weather api key\r\nweather = Weather('YOUR_API_KEY')\r\n\r\n# Get current weather from a city name\r\nw = weather.get_current_weather('CITY_NAME', unit=Unit.METRIC)\r\n\r\n# Get weather for more than one day\r\nw2 = weather.get_days_weather('CITY_NAME', unit=Unit.METRIC, days=Days.TWO)\r\n```\r\n\r\n## Documentation\r\n\r\n### Dependencies\r\n\r\n- requests\r\n\r\n### Unit\r\n\r\nUnit is a class which makes thing easier when you have to choose the unit type you want from the weather forecast.\r\nThe available units are:\r\n\r\n- Kelvin (Default option)\r\n- Metric\r\n- Fahrenheit\r\n\r\n##### Usage\r\n\r\n```\r\nUnit.METRIC # return 'metric'\r\nUnit.FAHRENHEIT # return 'imperail'\r\n...\r\n```\r\n\r\n### Days\r\n\r\nDays is a class which makes thing easier when you have to choose the number of days you want.\r\nThe lowest number is 2 and the maximum is 5 (which is the higher number of day set on the free version of the OpenWeatherAPI)\r\n\r\nThe available days are:\r\n\r\n- Two\r\n- Three\r\n- Four\r\n- Five (Default option)\r\n\r\n##### Usage\r\n\r\n```\r\nDays.TWO # return 2\r\nDays.THREE # return 3\r\n...\r\n```\r\n\r\n### Weather\r\n\r\nWeather is the class you'll need to use to interact with the OpenWeatherAPI.\r\nIt requires the OpenWeatherAPI key as its only parameter when you have to initialize it.\r\nLearn more about the [OpenWeatherAPI](https://openweathermap.org/api).\r\n\r\n#### Methods\r\n\r\n#### get_current_weather(city_name, unit = Unit.KELVIN)\r\n\r\nIt makes an http request (throught the [requests](http://2.python-requests.org/en/master/) package) to the OpenWeatherMap API to get the current weather forecast of the city you searched.\r\n\r\n| Parameter | Description                                                                         | Required |\r\n| --------- | ----------------------------------------------------------------------------------- | -------- |\r\n| city_name | a string that represents the city you want to know the weather                      | Yes      |\r\n| unit      | default unit is kelvin (You can leave it empty). See [Unit](#unit) for futher info. | No       |\r\n\r\nThis method returns a dictionary like the one below:\r\n\r\n```\r\n{\r\n        'is_status_code_ok': True,\r\n        'id': 2643743,\r\n        'name': 'London',\r\n        'country': 'GB',\r\n        'forecast':{\r\n            'main': 'Drizzle',\r\n            'description': 'light intensity drizzle',\r\n            'temperature': 280.32,\r\n            'humidity': 81,\r\n            'wind_speed': 4.1,\r\n            'icon': '09d'\r\n        }\r\n}\r\n```\r\n\r\nFor errors, see the [Errors](#errors) section.\r\n\r\n#### get_days_weather(self, city_name, unit = Unit.KELVIN, days = Days.FIVE)\r\n\r\nIf you want to know the weather of a city for a maximum of 5 days (including the current day) you have to use this method.\r\n\r\n| Parameter | Description                                                                          | Required |\r\n| --------- | ------------------------------------------------------------------------------------ | -------- |\r\n| city_name | a string that represents the city you want to know the weather                       | Yes      |\r\n| unit      | default unit is kelvin (You can leave it empty). See [Unit](#unit) for futher info.  | No       |\r\n| days      | default day is five [5] (You can leave it empty). See [Days](#Days) for futher info. | No       |\r\n\r\nThis method returns a dictionary like the one below (in this example the unit was metric and the days were two):\r\n\r\n```\r\n{\r\n   'is_status_code_ok':True,\r\n   'id':2643743,\r\n   'name':'London',\r\n   'country':'GB',\r\n   'forecasts':[\r\n      {\r\n         'date':'28/05/2019',\r\n         'temp_min':13,\r\n         'temp_max':18,\r\n         'weather':[\r\n            {\r\n               'time':'17:00:00',\r\n               'main':'Clear',\r\n               'description':'Clear sky',\r\n               'temperature':17,\r\n               'wind_speed':3.88,\r\n               'icon':'01d'\r\n            },\r\n            {\r\n               'time':'20:00:00',\r\n               'main':'Clear',\r\n               'description':'Clear sky',\r\n               'temperature':16,\r\n               'wind_speed':2.86,\r\n               'icon':'01d'\r\n            },\r\n            {\r\n               'time':'23:00:00',\r\n               'main':'Rain',\r\n               'description':'Light rain',\r\n               'temperature':13,\r\n               'wind_speed':0.68,\r\n               'icon':'10n'\r\n            }\r\n         ]\r\n      },\r\n      {\r\n         'date':'29/05/2019',\r\n         'temp_min':10,\r\n         'temp_max':18,\r\n         'weather':[\r\n            {\r\n               'time':'02:00:00',\r\n               'main':'Rain',\r\n               'description':'Light rain',\r\n               'temperature':11,\r\n               'wind_speed':1.35,\r\n               'icon':'10n'\r\n            },\r\n            {\r\n               'time':'05:00:00',\r\n               'main':'Clouds',\r\n               'description':'Overcast clouds',\r\n               'temperature':10,\r\n               'wind_speed':1.26,\r\n               'icon':'04n'\r\n            },\r\n            {\r\n               'time':'08:00:00',\r\n               'main':'Clouds',\r\n               'description':'Broken clouds',\r\n               'temperature':11,\r\n               'wind_speed':1.21,\r\n               'icon':'04d'\r\n            },\r\n            {\r\n               'time':'11:00:00',\r\n               'main':'Clouds',\r\n               'description':'Scattered clouds',\r\n               'temperature':15,\r\n               'wind_speed':1.57,\r\n               'icon':'03d'\r\n            },\r\n            {\r\n               'time':'14:00:00',\r\n               'main':'Clouds',\r\n               'description':'Scattered clouds',\r\n               'temperature':15,\r\n               'wind_speed':4.3,\r\n               'icon':'03d'\r\n            },\r\n            {\r\n               'time':'17:00:00',\r\n               'main':'Clouds',\r\n               'description':'Broken clouds',\r\n               'temperature':15,\r\n               'wind_speed':4.64,\r\n               'icon':'04d'\r\n            },\r\n            {\r\n               'time':'20:00:00',\r\n               'main':'Clouds',\r\n               'description':'Broken clouds',\r\n               'temperature':15,\r\n               'wind_speed':3.7,\r\n               'icon':'04d'\r\n            },\r\n            {\r\n               'time':'23:00:00',\r\n               'main':'Clouds',\r\n               'description':'Overcast clouds',\r\n               'temperature':14,\r\n               'wind_speed':3.79,\r\n               'icon':'04n'\r\n            }\r\n         ]\r\n      }\r\n   ]\r\n}\r\n```\r\n\r\nFor errors, see the [Errors](#errors) section.\r\n\r\n### Errors\r\n\r\nIn case something goes wrong this dictionary is what is returned:\r\n\r\n```\r\n{\r\n    'is_status_code_ok': False,\r\n    'cod': '404',\r\n    'message': 'city not found'\r\n}\r\n```\r\n\r\nCommon status code error:\r\n\r\n| Code | Description                                                                       |\r\n| ---- | --------------------------------------------------------------------------------- |\r\n| 400  | Bad Request - city_name or API_KEY not set                                        |\r\n| 401  | Invalid API key. Please see http://openweathermap.org/faq#error401 for more info. |\r\n| 404  | city not found                                                                    |\r\n| 429  | API key blocked                                                                   |\r\n| 500  | internal server error                                                             |\r\n\r\n#### Check the status code of your request\r\n\r\nIf you want to quickly check if your request was successful or not, just check the `is_status_code_ok` like:\r\n\r\n```\r\nw['is_status_code_ok']\r\n```\r\n\r\nIf the response status code is less than 400 it's `True` otherwise it's `False`\r\n\r\n## Built With\r\n\r\n- [Python](https://python.org) (3.7)\r\n\r\n## Version\r\n\r\n\u003e 1.1.0\r\n\r\nOptimization and cleanup code. Add `NoneType` control to the class constructur to prevent error.\r\n\r\n\u003e 1.0.2\r\n\r\nTemperature is now a int type\r\n\r\n\u003e 1.0.1\r\n\r\nAdd install_requires to setup.py file.\r\n\r\n\u003e 1.0.0\r\n\r\nInitial release. Include features like get the current weather of a city or get the weather of a city for more than one day.\r\n\r\n## Author\r\n\r\n\u003e **Cosimo Matteini** - [devmatteini on github](https://github.com/devmatteini)\r\n\r\n## License\r\n\r\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](https://github.com/devmatteini/forecastpy/blob/master/LICENSE) file for details\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmatteini%2Fforecastpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevmatteini%2Fforecastpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmatteini%2Fforecastpy/lists"}