pytuflow.ArrApiClient

pytuflow.ArrApiClient#

class ArrApiClient(base_url='https://data.arr-software.org/')#

Bases: object

Fetches data from the ARR Data Hub API for a single site (point or catchment boundary) config.

Failed requests (connection errors, timeouts, HTTP 429 and 5xx responses) are retried with exponential backoff. The number of retries is set by ArrConfig.max_retries.

Parameters:

base_url (str, optional) – The base URL of the ARR Data Hub API. Defaults to the public ARR Data Hub API (https://data.arr-software.org/).

__init__(base_url='https://data.arr-software.org/')#
Parameters:

base_url (str)

Return type:

None

Methods

build_params

Builds the query parameters for the API request, based on the config's site location (or catchment boundary) and which optional layers are required (e.g. climate change).

fetch

Requests data from the ARR Data Hub API for the given config's site (a lat/lon point, or an uploaded catchment boundary - see site.catchment_boundary), and returns the parsed response.

fetch_point_tp_for_coords

Requests the PointTP and ArealTP layers for arbitrary coordinates, used to fetch an "additional" temporal pattern region's own point (and, if available, areal) temporal patterns (see temporal_patterns.additional_tp / pytuflow.arr.temporal_patterns.fetch_additional_region_point_tp()).