zamg


Namezamg JSON
Version 0.3.6 PyPI version JSON
download
home_pagehttps://github.com/killer0071234/python-zamg
SummaryAsynchronous Python client for GeoSphere Austria (ZAMG) weather data.
upload_time2024-02-25 11:02:34
maintainerDaniel Gangl
docs_urlNone
authorDaniel Gangl
requires_python>=3.8,<4.0
licenseMIT
keywords geosphere zamg api async client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # python-zamg

[![GitHub Release][releases-shield]][releases]
[![GitHub Activity][commits-shield]][commits]
[![License][license-shield]](LICENSE)

[![pre-commit][pre-commit-shield]][pre-commit]
[![Black][black-shield]][black]
[![Code Coverage][codecov-shield]][codecov]

[![Project Maintenance][maintenance-shield]][user_profile]

Python library to read 10 min weather data from GeoSphere Austria former ZAMG

## About

This package allows you to read the weather data from weather stations of GeoSphere Austria weather service.
GeoSphere Austria joins Zentralanstalt für Meteorologie und Geodynamik (ZAMG) and the Geologische Bundesanstalt (GBA)
since 1st January 2023.

## Installation

```bash
pip install zamg
```

## Usage

Simple usage example to fetch specific data from the closest station.

```python
"""Asynchronous Python client for GeoSphere Austria weather data."""
import asyncio

import src.zamg.zamg
from src.zamg.exceptions import ZamgError


async def main():
    """Sample of getting data"""
    try:
        async with src.zamg.zamg.ZamgData() as zamg:
            # option to disable verify of ssl check
            zamg.verify_ssl = False
            # trying to read zamg station id of the closest station
            data = await zamg.closest_station(46.99, 15.499)
            # set closest station as default one to read
            zamg.set_default_station(data)
            print("closest_station = " + str(zamg.get_station_name) + " / " + str(data))
            # print list with all possible parameters
            print(f"Possible station parameters: {zamg.get_all_parameters()}")
            # set parameters directly
            zamg.station_parameters = "TL,SO"
            # or set parameters as list
            zamg.set_parameters(("TL", "SO"))
            # if none of the above parameters are set, all possible parameters are read
            # do an update
            await zamg.update()

            print(f"---------- Weather for station {zamg.get_station_name} ({data})")
            for param in zamg.get_parameters():
                print(
                    str(param)
                    + " -> "
                    + str(zamg.get_data(parameter=param, data_type="name"))
                    + " -> "
                    + str(zamg.get_data(parameter=param))
                    + " "
                    + str(zamg.get_data(parameter=param, data_type="unit"))
                )
            print("last update: %s", zamg.last_update)
    except (ZamgError) as exc:
        print(exc)


if __name__ == "__main__":
    asyncio.run(main())

```

## Contributions are welcome!

If you want to contribute to this please read the [Contribution guidelines](https://github.com/killer0071234/python-zamg/blob/master/CONTRIBUTING.md)

## Credits

Code template to read dataset API was mainly taken from [@LuisTheOne](https://github.com/LuisThe0ne)'s [zamg-api-cli-client][zamg_api_cli_client]

[Dataset API Dokumentation][dataset_api_doc]

---

[black]: https://github.com/psf/black
[black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge
[commits-shield]: https://img.shields.io/github/commit-activity/y/killer0071234/python-zamg.svg?style=for-the-badge
[commits]: https://github.com/killer0071234/python-zamg/commits/main
[codecov-shield]: https://img.shields.io/codecov/c/gh/killer0071234/python-zamg?style=for-the-badge&token=O5YDLF0X9G
[codecov]: https://codecov.io/gh/killer0071234/python-zamg
[license-shield]: https://img.shields.io/github/license/killer0071234/python-zamg.svg?style=for-the-badge
[maintenance-shield]: https://img.shields.io/badge/maintainer-@killer0071234-blue.svg?style=for-the-badge
[pre-commit]: https://github.com/pre-commit/pre-commit
[pre-commit-shield]: https://img.shields.io/badge/pre--commit-enabled-brightgreen?style=for-the-badge
[releases-shield]: https://img.shields.io/github/release/killer0071234/python-zamg.svg?style=for-the-badge
[releases]: https://github.com/killer0071234/python-zamg/releases
[user_profile]: https://github.com/killer0071234
[zamg_api_cli_client]: https://github.com/LuisThe0ne/zamg-api-cli-client
[dataset_api_doc]: https://github.com/Geosphere-Austria/dataset-api-docs


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/killer0071234/python-zamg",
    "name": "zamg",
    "maintainer": "Daniel Gangl",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "killer007@gmx.at",
    "keywords": "geosphere,zamg,api,async,client",
    "author": "Daniel Gangl",
    "author_email": "killer007@gmx.at",
    "download_url": "https://files.pythonhosted.org/packages/6b/45/72488830d7bcbb4290666f3300bd2a2e87ea54abba6b6d698a17a6d9a87a/zamg-0.3.6.tar.gz",
    "platform": null,
    "description": "# python-zamg\n\n[![GitHub Release][releases-shield]][releases]\n[![GitHub Activity][commits-shield]][commits]\n[![License][license-shield]](LICENSE)\n\n[![pre-commit][pre-commit-shield]][pre-commit]\n[![Black][black-shield]][black]\n[![Code Coverage][codecov-shield]][codecov]\n\n[![Project Maintenance][maintenance-shield]][user_profile]\n\nPython library to read 10 min weather data from GeoSphere Austria former ZAMG\n\n## About\n\nThis package allows you to read the weather data from weather stations of GeoSphere Austria weather service.\nGeoSphere Austria joins Zentralanstalt f\u00fcr Meteorologie und Geodynamik (ZAMG) and the Geologische Bundesanstalt (GBA)\nsince 1st January 2023.\n\n## Installation\n\n```bash\npip install zamg\n```\n\n## Usage\n\nSimple usage example to fetch specific data from the closest station.\n\n```python\n\"\"\"Asynchronous Python client for GeoSphere Austria weather data.\"\"\"\nimport asyncio\n\nimport src.zamg.zamg\nfrom src.zamg.exceptions import ZamgError\n\n\nasync def main():\n    \"\"\"Sample of getting data\"\"\"\n    try:\n        async with src.zamg.zamg.ZamgData() as zamg:\n            # option to disable verify of ssl check\n            zamg.verify_ssl = False\n            # trying to read zamg station id of the closest station\n            data = await zamg.closest_station(46.99, 15.499)\n            # set closest station as default one to read\n            zamg.set_default_station(data)\n            print(\"closest_station = \" + str(zamg.get_station_name) + \" / \" + str(data))\n            # print list with all possible parameters\n            print(f\"Possible station parameters: {zamg.get_all_parameters()}\")\n            # set parameters directly\n            zamg.station_parameters = \"TL,SO\"\n            # or set parameters as list\n            zamg.set_parameters((\"TL\", \"SO\"))\n            # if none of the above parameters are set, all possible parameters are read\n            # do an update\n            await zamg.update()\n\n            print(f\"---------- Weather for station {zamg.get_station_name} ({data})\")\n            for param in zamg.get_parameters():\n                print(\n                    str(param)\n                    + \" -> \"\n                    + str(zamg.get_data(parameter=param, data_type=\"name\"))\n                    + \" -> \"\n                    + str(zamg.get_data(parameter=param))\n                    + \" \"\n                    + str(zamg.get_data(parameter=param, data_type=\"unit\"))\n                )\n            print(\"last update: %s\", zamg.last_update)\n    except (ZamgError) as exc:\n        print(exc)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n```\n\n## Contributions are welcome!\n\nIf you want to contribute to this please read the [Contribution guidelines](https://github.com/killer0071234/python-zamg/blob/master/CONTRIBUTING.md)\n\n## Credits\n\nCode template to read dataset API was mainly taken from [@LuisTheOne](https://github.com/LuisThe0ne)'s [zamg-api-cli-client][zamg_api_cli_client]\n\n[Dataset API Dokumentation][dataset_api_doc]\n\n---\n\n[black]: https://github.com/psf/black\n[black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge\n[commits-shield]: https://img.shields.io/github/commit-activity/y/killer0071234/python-zamg.svg?style=for-the-badge\n[commits]: https://github.com/killer0071234/python-zamg/commits/main\n[codecov-shield]: https://img.shields.io/codecov/c/gh/killer0071234/python-zamg?style=for-the-badge&token=O5YDLF0X9G\n[codecov]: https://codecov.io/gh/killer0071234/python-zamg\n[license-shield]: https://img.shields.io/github/license/killer0071234/python-zamg.svg?style=for-the-badge\n[maintenance-shield]: https://img.shields.io/badge/maintainer-@killer0071234-blue.svg?style=for-the-badge\n[pre-commit]: https://github.com/pre-commit/pre-commit\n[pre-commit-shield]: https://img.shields.io/badge/pre--commit-enabled-brightgreen?style=for-the-badge\n[releases-shield]: https://img.shields.io/github/release/killer0071234/python-zamg.svg?style=for-the-badge\n[releases]: https://github.com/killer0071234/python-zamg/releases\n[user_profile]: https://github.com/killer0071234\n[zamg_api_cli_client]: https://github.com/LuisThe0ne/zamg-api-cli-client\n[dataset_api_doc]: https://github.com/Geosphere-Austria/dataset-api-docs\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Asynchronous Python client for GeoSphere Austria (ZAMG) weather data.",
    "version": "0.3.6",
    "project_urls": {
        "Bug Tracker": "https://github.com/killer0071234/python-zamg/issues",
        "Changelog": "https://github.com/killer0071234/python-zamg/releases",
        "Documentation": "https://github.com/killer0071234/python-zamg",
        "Homepage": "https://github.com/killer0071234/python-zamg",
        "Repository": "https://github.com/killer0071234/python-zamg"
    },
    "split_keywords": [
        "geosphere",
        "zamg",
        "api",
        "async",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7510e9574a670ce8a3a3e31b43d708c7178afb63469617e893e927628fe9334c",
                "md5": "e5b88580de37a7a38b97caa08ea02780",
                "sha256": "9b102bb05aa48a6ee4ab5f717319d0b8692476ab20ec3d7ee674e942e7fe1869"
            },
            "downloads": -1,
            "filename": "zamg-0.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e5b88580de37a7a38b97caa08ea02780",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 6784,
            "upload_time": "2024-02-25T11:02:33",
            "upload_time_iso_8601": "2024-02-25T11:02:33.438161Z",
            "url": "https://files.pythonhosted.org/packages/75/10/e9574a670ce8a3a3e31b43d708c7178afb63469617e893e927628fe9334c/zamg-0.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b4572488830d7bcbb4290666f3300bd2a2e87ea54abba6b6d698a17a6d9a87a",
                "md5": "284acaa8b89dfcbdf0d244310f15340a",
                "sha256": "6715066e8806860ae1bcacf47f79289ec438eba5cd774fb5e20ce4b9e2cfd996"
            },
            "downloads": -1,
            "filename": "zamg-0.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "284acaa8b89dfcbdf0d244310f15340a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 7136,
            "upload_time": "2024-02-25T11:02:34",
            "upload_time_iso_8601": "2024-02-25T11:02:34.662135Z",
            "url": "https://files.pythonhosted.org/packages/6b/45/72488830d7bcbb4290666f3300bd2a2e87ea54abba6b6d698a17a6d9a87a/zamg-0.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-25 11:02:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "killer0071234",
    "github_project": "python-zamg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "zamg"
}
        
Elapsed time: 0.17554s