Skip to content

Client

Client

A client for our data on source.coop.

__init__(config=None)

Initializes the client with HTTP and S3 stores.

Parameters:

Name Type Description Default
config Config | None

Optional configuration. Uses default Config if not provided.

None

get_borehole_data_urls()

Builds a mapping of borehole data URLs by variable and name.

Lists CSV files in the borehole data prefix and organizes them into a nested dict keyed by variable (e.g. "temp", "imp") then borehole name.

Returns:

Type Description
defaultdict[str, dict[str, str]]

A defaultdict mapping variable names to dicts of

defaultdict[str, dict[str, str]]

{borehole_name: url}.

get_boreholes()

Parses borehole locations from CSV text and attaches data URLs.

Parameters:

Name Type Description Default
text

Raw CSV content with borehole location data.

required
client

Optional client for fetching data URLs. Creates a default client if not provided.

required

Returns:

Type Description
list[Borehole]

A list of Borehole instances with data URLs populated.