Bases: Semantic
Represents a ROAK Project.
Attributes are dynamically accessed from the API response data.
Use snake_case names (e.g., owner_id, start_date) to access camelCase API fields.
Provides methods to fetch assets (wells, boreholes, rigs) within the project.
- Parameters:
-
-
get_assets(asset_type=None)[source]
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_asset_by_guid(guid)[source]
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)[source]
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_sites()[source]
Fetch all child sites in this project scope.
- Return type:
list[‘Site’]
-
get_site_by_guid(guid)[source]
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)[source]
Fetch a site by its name within this project scope.
- Parameters:
name (str)
allow_first_match (bool)
- Return type:
Site
-
get_wells()[source]
Fetch all wells in this project.
- Return type:
list[Well]
-
get_well_by_guid(guid)[source]
Fetch a well by its GUID.
- Parameters:
guid (str)
- Return type:
Well
-
get_well_by_name(name, allow_first_match=False)[source]
Fetch a well by its name.
- Parameters:
name (str)
allow_first_match (bool)
- Return type:
Well
-
get_boreholes()[source]
Fetch all boreholes in this project.
- Return type:
list[Borehole]
-
get_borehole_by_guid(guid)[source]
Fetch a borehole by its GUID.
- Parameters:
guid (str)
- Return type:
Borehole
-
get_borehole_by_name(name, allow_first_match=False)[source]
Fetch a borehole by its name.
- Parameters:
name (str)
allow_first_match (bool)
- Return type:
Borehole
-
get_attributes()
Get the locally cached attribute dictionary.
- Returns:
Raw data dictionary.
- Return type:
dict
-
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]
-
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:
-
-
guid: str
-
name: str