Site

Represents a Site within a project. Inherits project-level asset access methods.

class roak_sdk.semantics.site.Site(data, registry)[source]

Bases: Project

Represents a Site within a project.

Basically provides all the same functionality as Project, except the possibility to get the sites.

Parameters:
  • data (dict)

  • registry (ClientRegistry)

get_sites()[source]

Override to prevent hierarchical site nesting.

Raises:

NotImplementedError – Sites do not support containing child sites.

get_asset_by_guid(guid)

Fetch a single asset by its GUID.

Parameters:

guid (str) – GUID of the asset.

Returns:

The asset object.

Return type:

Asset

get_asset_by_name(name, asset_type=None, allow_first_match=False)

Fetch a single asset by name.

Parameters:
  • name (str) – Name of the asset.

  • asset_type (str | None) – Optional asset type filter.

  • allow_first_match (bool) – If True, return the first match when multiple assets share the same name.

Returns:

The asset object.

Return type:

Asset

get_assets(asset_type=None)

Fetch all assets in this project, optionally filtered by type.

Parameters:

asset_type (str | None) – Optional asset type filter (e.g., “well”, “borehole”, “rig”).

Returns:

List of Asset objects.

Return type:

list[Asset]

get_attributes()

Get the locally cached attribute dictionary.

Returns:

Raw data dictionary.

Return type:

dict

get_borehole_by_guid(guid)

Fetch a borehole by its GUID.

Parameters:

guid (str)

Return type:

Borehole

get_borehole_by_name(name, allow_first_match=False)

Fetch a borehole by its name.

Parameters:
  • name (str)

  • allow_first_match (bool)

Return type:

Borehole

get_boreholes()

Fetch all boreholes in this project.

Return type:

list[Borehole]

get_last_values()

Get one last-reading summary row per feed for this semantic.

Returns rows with:
  • feedname

  • last_value

  • unit (unit.name)

  • record_time

Return type:

list[dict]

get_site_by_guid(guid)

Fetch a site by its GUID within this project scope.

Parameters:

guid (str)

Return type:

Site

get_site_by_name(name, allow_first_match=False)

Fetch a site by its name within this project scope.

Parameters:
  • name (str)

  • allow_first_match (bool)

Return type:

Site

get_well_by_guid(guid)

Fetch a well by its GUID.

Parameters:

guid (str)

Return type:

Well

get_well_by_name(name, allow_first_match=False)

Fetch a well by its name.

Parameters:
  • name (str)

  • allow_first_match (bool)

Return type:

Well

get_wells()

Fetch all wells in this project.

Return type:

list[Well]

refresh_attributes()

Fetch semantic attributes for this semantic and merge into _data.

Expects the API payload shape to be paged, with the attribute list in payload["content"].

Returns:

Updated attributes dictionary.

Return type:

dict

Raises:
  • KeyError – If content is missing from the API payload.

  • TypeError – If content is not iterable as expected.

guid: str
name: str