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 zamg.zamg
from zamg.exceptions import ZamgError


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

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


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

Simple usage example to fetch weather forecast for a specific location.

"""Asynchronous Python client for GeoSphere Austria forecast weather data."""

import asyncio

import zamg.zamg
from zamg.exceptions import ZamgError


async def main():
    """Sample of getting data"""
    try:
        async with zamg.zamg.ZamgData() as zamg_instance:
            # option to disable verify of ssl check
            zamg_instance.verify_ssl = False
            # trying to read GeoSphere Austria station id of the closest station
            data = await zamg_instance.closest_station(46.99, 15.499)
            # set closest station as default one to read
            zamg_instance.set_default_station(data)
            # print(f"forecast_metadata: {zamg_instance.forecast_metadata}")
            # print(f"get_forecast_all_parameters: {zamg_instance.get_forecast_all_parameters()}")

            data = await zamg_instance.get_forecast("46.99,15.499", current_only=True)
            print(f"get_forecast(current_only=True): {data}")
            # get forecast for the default station (closest station) with all parameters
            data = await zamg_instance.get_forecast(current_only=False)
            print(f"get_forecast(current_only=False): {data}")

    except ZamgError as exc:
        print(exc)


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

The forecast contains the GeoSphere Austria weather symbol (sy parameter) as a numeric code. It is automatically translated into a textual description (sy_text) and a Home Assistant weather condition (condition). The translation helpers can also be used directly:

from zamg import symbol_to_condition, symbol_to_text

print(symbol_to_text(3))  # "Partly cloudy"
print(symbol_to_text(3, lang="de"))  # "Wolkig"
print(symbol_to_condition(3))  # "partlycloudy"

The official (German) symbol code list is documented in Geosphere-Austria/dataset-api-docs#30.

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


Metadata

Release files for zamg 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zamg 0.4.2
File Size Uploaded
zamg-0.4.2.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zamg 0.4.2
File Interpreter ABI Platform
zamg-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / zamg-0.4.2.tar.gz

Download URL zamg-0.4.2.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2d60c168101d16fc05df3b79861d6f33353ea7b7c765ac8260a08c2de14828ef
BLAKE2b-256 checksum
How to use checksums
0e0baea5ad4c62240bf233950ea675a55b03cc5152630cdcec2fe7de223eafc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / zamg-0.4.2-py3-none-any.whl

Download URL zamg-0.4.2-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ba1157f8d5d17609e60f0441314cbb3706382c0d09d40f96c1916413355f345
BLAKE2b-256 checksum
How to use checksums
f57fd9e36acca6c02cbe2e4b4c8f8062eb15d50b7fc092db17c19a15ee299825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page