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

"""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-5.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

gios-5.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gios-5.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gios-5.0.0.tar.gz
Algorithm Hash digest
SHA256 3448ec8a04bf3727b55a750030d0336ac589e45180a5be8fc732be5181aac1aa
MD5 f508f3813cb9687a69ac6d504c2fd4a3
BLAKE2b-256 5601aec7a51f9d08b6aeb1976a67e458ee44e9101bd4dcffe50255b4e45e87fe

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gios-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a243d14fe74dc73882f50ddcc7506495fe893e2ca64cba3dd20a8370e9f2ed8
MD5 1123bf33e7cc770675055ab619a4f41f
BLAKE2b-256 f2b58d15f9df0359af0842f884cee3935bb03ce8f5ee331ac0b9c6ed7a4fe5c9

See more details on using hashes here.

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