Skip to main content

niluclient

Python client for getting air pollution data from NILU sensor stations in Norway. The package comes with clients that can fetch and cache data from nilus api.

Buy me a coffee

Acknowledgements

According to the api documentation from nilu.no and luftkvalitet.info, when using data fetched through this client an acknowledgement to both nilu.no and luftkvalitet.info needs to be included.

Usage

Finding all station in an area:

import niluclient as nilu

stations = nilu.lookup_stations_in_area('Bergen')

Finding all stations and sensor reading within 20 km from a location:

import niluclient as nilu

client = nilu.create_location_client(60.123456, 5.123456)

# name of all stations found.
station_names = client.station_names

# dict of all stations with readings.
stations = client.station_data

# all stations NO2 readings
for station in stations:
    no2_value = station.sensors[nilu.NO2].value

Finding readings from a specified station, and update cached value:

import niluclient as nilu

client = nilu.create_station_client('Kannik')
no2_value = client.data.sensors[nilu.NO2].value
no2_unit = client.data.sensors[nilu.NO2].unit_of_measurement

# after an hour. (Data from the api will only update on the hour) 
client.update()

new_no2_value = client.data.sensors[nilu.NO2].value

Client api coverage

Air quality index: Fetch measured value and index.

  • GET /aq/utd (Implemented for station filtering) - niluclient.NiluStationClient
  • GET /aq/utd/{latitude}/{longitude}/{radius} - niluclient.NiluLocationClient
  • GET /aq/historical/{fromtime}/{totime}/{station}
  • GET /aq/historical/{fromtime}/{totime}/{latitude}/{longitude}/{radius}

Observations: Fetch measured value.

  • GET /obs/utd
  • GET /obs/utd/{latitude}/{longitude}/{radius}
  • GET /obs/historical/{fromtime}/{totime}/{station}
  • GET /obs/historical/{fromtime}/{totime}/{latitude}/{longitude}/{radius}

Day average Calculates day average for a given time period.

  • GET /stats/day/{fromtime}/{totime}/{station}
  • GET /stats/day/{fromtime}/{totime}/{latitude}/{longitude}/{radius}

Lookup api: Lists metadata used for filtering.

  • GET /lookup/areas - (Partially with the niluclient.AREAS constants)
  • GET /lookup/stations - niluclient.lookup_stations_in_area('')
  • GET /lookup/components - (Partially with the niluclient.MEASURABLE_COMPONENTS constants)
  • GET /lookup/aqis

Source: endpoints and description fetched from nilu api documentation

Metadata

Release files for niluclient 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for niluclient 0.1.2
File Size Uploaded Provenance Actions
niluclient-0.1.2.tar.gz 4.0 kB Without provenance Details for niluclient-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for niluclient 0.1.2
File Interpreter ABI Platform Actions
niluclient-0.1.2-py3-none-any.whl Python 3 none any Details for niluclient-0.1.2-py3-none-any.whl

Total release size: 9.1 kB

Release files / niluclient-0.1.2.tar.gz

Download URL niluclient-0.1.2.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
381a0008f325b9c7eac9bcbf002ce56f08c1257db477e12ccb90519219b0d587
BLAKE2b-256 checksum
How to use checksums
80231e1f75cf22d509a9806a717dc8469046a099bcb24a73a4dc9f5b411eff7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release files / niluclient-0.1.2-py3-none-any.whl

Download URL niluclient-0.1.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
497d245a74cc2254c2245cd50a7d8789d6207ed632a2f71e6773078a34825e94
BLAKE2b-256 checksum
How to use checksums
1b80ca268c11063abaaad2cdb0b69f5aff5ed5a6f22f678c6ac2d7b64edbd6f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Security for niluclient 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page