# Python: Asynchronous client for the Open-Meteo API.
[![GitHub Release][releases-shield]][releases]
[![Python Versions][python-versions-shield]][pypi]
![Project Stage][project-stage-shield]
![Project Maintenance][maintenance-shield]
[![License][license-shield]](LICENSE.md)
[![Build Status][build-shield]][build]
[![Code Coverage][codecov-shield]][codecov]
[![Quality Gate Status][sonarcloud-shield]][sonarcloud]
[![Open in Dev Containers][devcontainer-shield]][devcontainer]
[![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors]
[![Support Frenck on Patreon][patreon-shield]][patreon]
Asynchronous client for the Open-Meteo API.
## About
Open-Meteo offers free weather forecast APIs for open-source developers and
non-commercial use. No API key is required. You can start using it immediately!
## Installation
```bash
pip install open-meteo
```
## Usage
```python
import asyncio
from open_meteo import OpenMeteo
from open_meteo.models import DailyParameters, HourlyParameters
async def main():
"""Show example on using the Open-Meteo API client."""
async with OpenMeteo() as open_meteo:
forecast = await open_meteo.forecast(
latitude=52.27,
longitude=6.87417,
current_weather=True,
daily=[
DailyParameters.SUNRISE,
DailyParameters.SUNSET,
],
hourly=[
HourlyParameters.TEMPERATURE_2M,
HourlyParameters.RELATIVE_HUMIDITY_2M,
],
)
print(forecast)
if __name__ == "__main__":
asyncio.run(main())
```
## Changelog & Releases
This repository keeps a change log using [GitHub's releases][releases]
functionality. The format of the log is based on
[Keep a Changelog][keepchangelog].
Releases are based on [Semantic Versioning][semver], and use the format
of `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented
based on the following:
- `MAJOR`: Incompatible or major changes.
- `MINOR`: Backwards-compatible new features and enhancements.
- `PATCH`: Backwards-compatible bugfixes and package updates.
## Contributing
This is an active open-source project. We are always open to people who want to
use the code or contribute to it.
We've set up a separate document for our
[contribution guidelines](CONTRIBUTING.md).
Thank you for being involved! :heart_eyes:
## Setting up development environment
This Python project is fully managed using the [Poetry][poetry] dependency
manager. But also relies on the use of NodeJS for certain checks during
development.
You need at least:
- Python 3.11+
- [Poetry][poetry-install]
- NodeJS 20+ (including NPM)
To install all packages, including all development requirements:
```bash
npm install
poetry install
```
As this repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. You can run all checks and tests
manually, using the following command:
```bash
poetry run pre-commit run --all-files
```
To run just the Python tests:
```bash
poetry run pytest
```
## Authors & contributors
The original setup of this repository is by [Franck Nijhof][frenck].
For a full list of all authors and contributors,
check [the contributor's page][contributors].
## License
MIT License
Copyright (c) 2021-2023 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[build-shield]: https://github.com/frenck/python-open-meteo/actions/workflows/tests.yaml/badge.svg
[build]: https://github.com/frenck/python-open-meteo/actions/workflows/tests.yaml
[codecov-shield]: https://codecov.io/gh/frenck/python-open-meteo/branch/main/graph/badge.svg
[codecov]: https://codecov.io/gh/frenck/python-open-meteo
[contributors]: https://github.com/frenck/python-open-meteo/graphs/contributors
[devcontainer-shield]: https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode
[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/frenck/python-open-meteo
[frenck]: https://github.com/frenck
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
[github-sponsors]: https://github.com/sponsors/frenck
[keepchangelog]: http://keepachangelog.com/en/1.0.0/
[license-shield]: https://img.shields.io/github/license/frenck/python-open-meteo.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck
[poetry-install]: https://python-poetry.org/docs/#installation
[poetry]: https://python-poetry.org
[pre-commit]: https://pre-commit.com/
[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg
[pypi]: https://pypi.org/project/open-meteo/
[python-versions-shield]: https://img.shields.io/pypi/pyversions/open-meteo
[releases-shield]: https://img.shields.io/github/release/frenck/python-open-meteo.svg
[releases]: https://github.com/frenck/python-open-meteo/releases
[semver]: http://semver.org/spec/v2.0.0.html
[sonarcloud-shield]: https://sonarcloud.io/api/project_badges/measure?project=frenck_python-open-meteo&metric=alert_status
[sonarcloud]: https://sonarcloud.io/summary/new_code?id=frenck_python-open-meteo
Raw data
{
"_id": null,
"home_page": "https://github.com/frenck/python-open-meteo",
"name": "open-meteo",
"maintainer": "Franck Nijhof",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "opensource@frenck.dev",
"keywords": "weather,weather-api,meteo,openmeteo,open-meteo,api,async,client",
"author": "Franck Nijhof",
"author_email": "opensource@frenck.dev",
"download_url": "https://files.pythonhosted.org/packages/a6/d6/800f5f3e57d907fbf95a196cc8da4552c42d8bd9208a1f3b8e738ae56dc6/open_meteo-0.3.1.tar.gz",
"platform": null,
"description": "# Python: Asynchronous client for the Open-Meteo API.\n\n[![GitHub Release][releases-shield]][releases]\n[![Python Versions][python-versions-shield]][pypi]\n![Project Stage][project-stage-shield]\n![Project Maintenance][maintenance-shield]\n[![License][license-shield]](LICENSE.md)\n\n[![Build Status][build-shield]][build]\n[![Code Coverage][codecov-shield]][codecov]\n[![Quality Gate Status][sonarcloud-shield]][sonarcloud]\n[![Open in Dev Containers][devcontainer-shield]][devcontainer]\n\n[![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors]\n\n[![Support Frenck on Patreon][patreon-shield]][patreon]\n\nAsynchronous client for the Open-Meteo API.\n\n## About\n\nOpen-Meteo offers free weather forecast APIs for open-source developers and\nnon-commercial use. No API key is required. You can start using it immediately!\n\n## Installation\n\n```bash\npip install open-meteo\n```\n\n## Usage\n\n```python\nimport asyncio\n\nfrom open_meteo import OpenMeteo\nfrom open_meteo.models import DailyParameters, HourlyParameters\n\n\nasync def main():\n \"\"\"Show example on using the Open-Meteo API client.\"\"\"\n async with OpenMeteo() as open_meteo:\n forecast = await open_meteo.forecast(\n latitude=52.27,\n longitude=6.87417,\n current_weather=True,\n daily=[\n DailyParameters.SUNRISE,\n DailyParameters.SUNSET,\n ],\n hourly=[\n HourlyParameters.TEMPERATURE_2M,\n HourlyParameters.RELATIVE_HUMIDITY_2M,\n ],\n )\n print(forecast)\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## Changelog & Releases\n\nThis repository keeps a change log using [GitHub's releases][releases]\nfunctionality. The format of the log is based on\n[Keep a Changelog][keepchangelog].\n\nReleases are based on [Semantic Versioning][semver], and use the format\nof `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented\nbased on the following:\n\n- `MAJOR`: Incompatible or major changes.\n- `MINOR`: Backwards-compatible new features and enhancements.\n- `PATCH`: Backwards-compatible bugfixes and package updates.\n\n## Contributing\n\nThis is an active open-source project. We are always open to people who want to\nuse the code or contribute to it.\n\nWe've set up a separate document for our\n[contribution guidelines](CONTRIBUTING.md).\n\nThank you for being involved! :heart_eyes:\n\n## Setting up development environment\n\nThis Python project is fully managed using the [Poetry][poetry] dependency\nmanager. But also relies on the use of NodeJS for certain checks during\ndevelopment.\n\nYou need at least:\n\n- Python 3.11+\n- [Poetry][poetry-install]\n- NodeJS 20+ (including NPM)\n\nTo install all packages, including all development requirements:\n\n```bash\nnpm install\npoetry install\n```\n\nAs this repository uses the [pre-commit][pre-commit] framework, all changes\nare linted and tested with each commit. You can run all checks and tests\nmanually, using the following command:\n\n```bash\npoetry run pre-commit run --all-files\n```\n\nTo run just the Python tests:\n\n```bash\npoetry run pytest\n```\n\n## Authors & contributors\n\nThe original setup of this repository is by [Franck Nijhof][frenck].\n\nFor a full list of all authors and contributors,\ncheck [the contributor's page][contributors].\n\n## License\n\nMIT License\n\nCopyright (c) 2021-2023 Franck Nijhof\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n[build-shield]: https://github.com/frenck/python-open-meteo/actions/workflows/tests.yaml/badge.svg\n[build]: https://github.com/frenck/python-open-meteo/actions/workflows/tests.yaml\n[codecov-shield]: https://codecov.io/gh/frenck/python-open-meteo/branch/main/graph/badge.svg\n[codecov]: https://codecov.io/gh/frenck/python-open-meteo\n[contributors]: https://github.com/frenck/python-open-meteo/graphs/contributors\n[devcontainer-shield]: https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode\n[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/frenck/python-open-meteo\n[frenck]: https://github.com/frenck\n[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png\n[github-sponsors]: https://github.com/sponsors/frenck\n[keepchangelog]: http://keepachangelog.com/en/1.0.0/\n[license-shield]: https://img.shields.io/github/license/frenck/python-open-meteo.svg\n[maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg\n[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png\n[patreon]: https://www.patreon.com/frenck\n[poetry-install]: https://python-poetry.org/docs/#installation\n[poetry]: https://python-poetry.org\n[pre-commit]: https://pre-commit.com/\n[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg\n[pypi]: https://pypi.org/project/open-meteo/\n[python-versions-shield]: https://img.shields.io/pypi/pyversions/open-meteo\n[releases-shield]: https://img.shields.io/github/release/frenck/python-open-meteo.svg\n[releases]: https://github.com/frenck/python-open-meteo/releases\n[semver]: http://semver.org/spec/v2.0.0.html\n[sonarcloud-shield]: https://sonarcloud.io/api/project_badges/measure?project=frenck_python-open-meteo&metric=alert_status\n[sonarcloud]: https://sonarcloud.io/summary/new_code?id=frenck_python-open-meteo\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Asynchronous client for the Open-Meteo API.",
"version": "0.3.1",
"project_urls": {
"Bug Tracker": "https://github.com/frenck/python-open-meteo/issues",
"Changelog": "https://github.com/frenck/python-open-meteo/releases",
"Documentation": "https://github.com/frenck/python-open-meteo",
"Homepage": "https://github.com/frenck/python-open-meteo",
"Repository": "https://github.com/frenck/python-open-meteo"
},
"split_keywords": [
"weather",
"weather-api",
"meteo",
"openmeteo",
"open-meteo",
"api",
"async",
"client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a9bc918500681cbc35e84135089f794e15fc2c187d7d952b1d15a204073d159d",
"md5": "9d14901ec2a00b0c8664f73fbadf8ac8",
"sha256": "b787ab5f32ebd22b7c35512511faf48ad37342dd51e42c89301b9b1fd83bcfb5"
},
"downloads": -1,
"filename": "open_meteo-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9d14901ec2a00b0c8664f73fbadf8ac8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 10951,
"upload_time": "2023-11-07T19:37:32",
"upload_time_iso_8601": "2023-11-07T19:37:32.188855Z",
"url": "https://files.pythonhosted.org/packages/a9/bc/918500681cbc35e84135089f794e15fc2c187d7d952b1d15a204073d159d/open_meteo-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a6d6800f5f3e57d907fbf95a196cc8da4552c42d8bd9208a1f3b8e738ae56dc6",
"md5": "a93212a4673f8946006ce435f83d8333",
"sha256": "49537a9b214ef1958b33fe7763ec2d89aa1512266e1c1af357f7de8046999f69"
},
"downloads": -1,
"filename": "open_meteo-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "a93212a4673f8946006ce435f83d8333",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 12582,
"upload_time": "2023-11-07T19:37:33",
"upload_time_iso_8601": "2023-11-07T19:37:33.438340Z",
"url": "https://files.pythonhosted.org/packages/a6/d6/800f5f3e57d907fbf95a196cc8da4552c42d8bd9208a1f3b8e738ae56dc6/open_meteo-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-07 19:37:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "frenck",
"github_project": "python-open-meteo",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "open-meteo"
}