Python wrapper for getting air quality data from GIOŚ servers.
Project description
gios
Python wrapper for getting air quality data from GIOŚ (Główny Inspektorat Ochrony Środowiska)
How to find station_id
- go to http://powietrze.gios.gov.pl/pjp/current
- find on the map a measurement station located closest to your home
- go to "More infotmation" link
- look at site address, for ex. for this address https://powietrze.gios.gov.pl/pjp/current/station_details/table/10124/3/0
station_idis 10124
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gios-7.0.0.tar.gz
(11.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
gios-7.0.0-py3-none-any.whl
(10.5 kB
view details)
File details
Details for the file gios-7.0.0.tar.gz.
File metadata
- Download URL: gios-7.0.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4235d4648f48f125b0b05e63cf657c6d074134477775477a56783ee8ed35c98c
|
|
| MD5 |
661d543188463d4de91e3167e401022e
|
|
| BLAKE2b-256 |
fba62fb38898b5626e4de1177c98ee046173d34233a192988fdabad1041b87af
|
File details
Details for the file gios-7.0.0-py3-none-any.whl.
File metadata
- Download URL: gios-7.0.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f13532389ce27d5c23c5c5155f7768ad9a36792ca0948dce3e164095080897b8
|
|
| MD5 |
d366567d3cf2abd405088e3e1558fbbf
|
|
| BLAKE2b-256 |
1824735e0f94e5eb2bbc9abc647e799dda28f2c32e9f9f9cfae7d0b34c158931
|