Skip to main content

Asynchronous library to retrieve data from PEGELONLINE.

Project description

Test codecov Maintainability Library version Supported versions Downloads Formated with Black

aiopegelonline

Asynchronous library to retrieve data from PEGELONLINE.

:warning: this is in early development state :warning:

breaking changes may occure at every time

Requirements

  • Python >= 3.9
  • aiohttp

Installation

pip install aiopegelonline

Examples

Get all available measurement stations

import asyncio
import aiohttp
from aiopegelonline import PegelOnline


async def main():
    async with aiohttp.ClientSession() as session:
        pegelonline = PegelOnline(session)
        stations = await pegelonline.async_get_all_stations()
        for uuid, station in stations.items():
            print(f"uuid: {uuid} name: {station.name}")


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

Get current measurement

import asyncio
import aiohttp
from aiopegelonline import PegelOnline


async def main():
    async with aiohttp.ClientSession() as session:
        pegelonline = PegelOnline(session)
        measurements = await pegelonline.async_get_station_measurements("70272185-b2b3-4178-96b8-43bea330dcae")

    for name, data in measurements.as_dict().items():
        if data is None:
            print(f"{name} not provided by measurement station")
        else:
            print(f"{name}: {data.value} {data.uom}")

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

References


You like my work?

Buy Me A Coffee

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

aiopegelonline-0.1.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file aiopegelonline-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aiopegelonline-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for aiopegelonline-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cd27ddf4319bc4638f0a9367a1816c711ec187ef18f8caa786a30740b8f2238
MD5 7513de18d2b93bc85fe10b258d8b51e8
BLAKE2b-256 b2f2813733448b7edcce7c22c0ba2cce0d04f2b245cef1a4d9737938834a9c5c

See more details on using hashes here.

Supported by

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