airbase.parquet_api.client module

Client for Parquet downloads API v1 https://eeadmz1-downloads-api-appservice.azurewebsites.net/swagger/index.html

class airbase.parquet_api.client.Client(*, timeout=None, max_concurrent=10)[source]

Bases: AbstractAsyncContextManager

Handle for requests to Parquet downloads API v1 https://eeadmz1-downloads-api-appservice.azurewebsites.net/swagger/index.html

Parameters:
  • timeout (float | None) –

  • max_concurrent (int) –

async city(payload)[source]

post request to /City

Parameters:

payload (tuple[str, ...]) –

Return type:

CityJSON

async country()[source]

get request to /Country

Return type:

CountryJSON

async download_binary(url, path)[source]

get request to url, write response body content (in binary form) into a a binary file, and return path (exactly as the input)

Parameters:
  • url (str) –

  • path (Path) –

Return type:

Path

async download_metadata(path)[source]

download compressed metadata file and returns path to uncompressed csv

Parameters:

path (Path) –

Return type:

Path

async download_summary(payload)[source]

post request to /DownloadSummary

Parameters:

payload (ParquetDataJSON) –

Return type:

DownloadSummaryJSON

async download_urls(payload)[source]

post request to /ParquetFile/urls

Parameters:

payload (ParquetDataJSON) –

Return type:

str

async pollutant()[source]

get request to /Property

Return type:

PollutantJSON

airbase.parquet_api.client.extract_metadata_csv(archive, metadata)[source]

extract metadata CSV from zip file

Parameters:
  • archive (Path) –

  • metadata (Path) –

Return type:

Path