airbase.csv_api.dataset module

class airbase.csv_api.dataset.CSVData(country, pollutant_id, source, year, city=None, output=Output.TEXT)[source]

Bases: NamedTuple

info needed for requesting the URLs for country, source, year and pollutant_id the request can be further restricted with the city param

Create new instance of CSVData(country, pollutant_id, source, year, city, output)

Parameters:
  • country (str) –

  • pollutant_id (int | Literal['']) –

  • source (Source) –

  • year (int) –

  • city (str | None) –

  • output (Output) –

city: str | None

Alias for field number 4

country: str

Alias for field number 0

output: Output

Alias for field number 5

param()[source]
Return type:

CSVDataJSON

pollutant_id: int | Literal['']

Alias for field number 1

source: Source

Alias for field number 2

year: int

Alias for field number 3

class airbase.csv_api.dataset.Output(value)[source]

Bases: str, Enum

An enumeration.

HTML = 'HTML'
TEXT = 'TEXT'
class airbase.csv_api.dataset.Source(value)[source]

Bases: str, Enum

E1a: Verified data from 2013 to 2023 reported by countries by 30 September each year for the previous year. E2a: Unverified data transmitted continuously data from the beginning of 2024. ALL: E1a and E2a

NOTE - only 2024 data available -> no E2a data

ALL = 'ALL'
Unverified = 'E2a'
Verified = 'E1a'
airbase.csv_api.dataset.request_info_by_city(source, year, *cities, pollutants=None)[source]

download info one city at the time

Parameters:
  • source (Source) –

  • year (int) –

  • cities (str) –

  • pollutants (frozenset[str] | set[str] | None) –

Return type:

set[airbase.csv_api.dataset.CSVData]

airbase.csv_api.dataset.request_info_by_country(source, year, *countries, pollutants=None)[source]

download info one country at the time

Parameters:
  • source (Source) –

  • year (int) –

  • countries (str) –

  • pollutants (frozenset[str] | set[str] | None) –

Return type:

set[airbase.csv_api.dataset.CSVData]