Skip to main content

Python wrapper for getting air quality data from GIOŚ servers.

Project description

GitHub Release PyPI PyPI - Downloads Buy me a coffee PayPal_Me Revolut.Me

gios

Python wrapper for getting air quality data from GIOŚ (Główny Inspektorat Ochrony Środowiska)

How to find station_id

How to use package

"""Example for GIOS."""
import asyncio
import logging

from aiohttp import ClientError, ClientSession

from gios import ApiError, Gios, InvalidSensorsData, NoStationError

GIOS_STATION_ID = 568

logging.basicConfig(level=logging.DEBUG)


async def main() -> None:
    """Run main function."""
    async with ClientSession() as websession:
        gios = Gios(GIOS_STATION_ID, websession)
        try:
            data = await gios.async_update()
        except (ApiError, NoStationError, InvalidSensorsData, ClientError) as error:
            print(error)
            return

    latitude = gios.latitude
    longitude = gios.longitude
    station_name = gios.station_name
    print(f"Longitude: {longitude}")
    print(f"Latitude: {latitude}")
    print(f"Station name: {station_name}")
    print(data)


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Project details


Download files

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

Source Distribution

gios-6.0.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

gios-6.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file gios-6.0.0.tar.gz.

File metadata

  • Download URL: gios-6.0.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gios-6.0.0.tar.gz
Algorithm Hash digest
SHA256 f5aedac0fed9d0d0ba14c1499347271f2a8fbc3cb8297be8181552a138d6c7ec
MD5 d8078e9ed4702097d53e1e4cedf14354
BLAKE2b-256 56ace22c90f5242a1027cf61edfa4938a9c6196e34f783c1556a64c72252842c

See more details on using hashes here.

File details

Details for the file gios-6.0.0-py3-none-any.whl.

File metadata

  • Download URL: gios-6.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gios-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aff205e2dbae7fa90f9d4f6821e109447f6d14a0c55ef51256a904ea18ea3e0a
MD5 a67e5440f8fe26869a42e9a45d16a169
BLAKE2b-256 2fe9685e63a49872e3e3521434578a35cad06fee4c7101751948dc822280ad4a

See more details on using hashes here.

Supported by

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