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

gios

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

How to find station_id

How to use package

import asyncio
import logging

from aiohttp import ClientError, ClientSession
from gios import ApiError, InvalidSensorsData, Gios, NoStationError

GIOS_STATION_ID = 117

logging.basicConfig(level=logging.DEBUG)

async def main():
    try:
        async with ClientSession() as websession:
            gios = Gios(GIOS_STATION_ID, websession)
            data = await gios.async_update()
    except (ApiError, NoStationError, InvalidSensorsData, ClientError) as error:
        print(f"{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-2.1.0.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

gios-2.1.0-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

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