Skip to main content

python-zamg

GitHub Release GitHub Activity License

pre-commit Black Code Coverage

Project Maintenance

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

pip install zamg

Usage

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

"""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 GeoSphere Austria 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

Credits

Code template to read dataset API was mainly taken from @LuisTheOne's zamg-api-cli-client

Dataset API Dokumentation


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zamg-0.4.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zamg-0.4.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file zamg-0.4.0.tar.gz.

File metadata

  • Download URL: zamg-0.4.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/6.12.76-linuxkit

File hashes

Hashes for zamg-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8a06477689e68d93fe19474c6c348be5753e6bcdd2e5575638d776a01ab7e32a
MD5 69c6cb9d7c1ad6158eb79a136b260938
BLAKE2b-256 ed66387a5c482f1e12c88b4ffa9cede6fa684308c93d1ebe914d7b00d645f012

See more details on using hashes here.

File details

Details for the file zamg-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: zamg-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/6.12.76-linuxkit

File hashes

Hashes for zamg-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0fdbc545edea890ffaf51a54056401d8a01ffca9bfcccb7613a88c9801b4bad
MD5 1db5646048ea86c29e3281e9c22e8c51
BLAKE2b-256 c717ed2373e69c3c4902cefaf8d4e18bc873ba6a34b0c91bc819258f05be17ec

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.3

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page