rhino_health.lib.endpoints.project.project_endpoints#

Module Contents#

Classes#

ProjectEndpoints

Endpoints available to interact with Projects on the Rhino Platform

Functions#

handle_resource_management_response(response)

rhino_health.lib.endpoints.project.project_endpoints.handle_resource_management_response(response)#
class rhino_health.lib.endpoints.project.project_endpoints.ProjectEndpoints(session)#

Endpoints available to interact with Projects on the Rhino Platform

Notes

You should access these endpoints from the RhinoSession object

get_project_by_name(name: str)#

Returns Project dataclass

Parameters:
name: str

Full name for the Project

Returns:
project: LTSProject

Project dataclass that match the name

Examples

>>> session.project.get_project_by_name(my_project_name)
Project()
search_for_projects_by_name(name: str, name_filter_mode: rhino_health.lib.endpoints.endpoint.NameFilterMode | None = NameFilterMode.CONTAINS)#

Returns Project dataclasses

Parameters:
name: str

Full or partial name for the Project

name_filter_mode: Optional[NameFilterMode]

Only return results with the specified matching mode

Returns:
projects: List[LTSProject]

Project dataclasses that match the name

See also

rhino_health.lib.endpoints.endpoint.FilterMode

Different modes to filter by

Examples

>>> session.project.search_for_projects_by_name(my_project_name)
[Project()]
get_project_stats(project_uid: str) Dict[str, Any]#
add_project(project: rhino_health.lib.endpoints.project.project_dataclass.ProjectCreateInput) rhino_health.lib.endpoints.project.project_dataclass.LTSProject#

Adds a new project owned by the currently logged in user.

Warning

This feature is under development and the interface may change

get_datasets(project_uid: str) List[rhino_health.lib.endpoints.dataset.dataset_dataclass.LTSDataset]#

Returns Datasets associated with the project_uid

get_dataset_by_name(name, version=VersionMode.LATEST, project_uid=None) rhino_health.lib.endpoints.dataset.dataset_dataclass.LTSDataset | None#

Returns Dataset dataclass

See also

rhino_health.lib.endpoints.dataset.dataset_endpoints.get_dataset_by_name
search_for_datasets_by_name(name, version=VersionMode.LATEST, project_uid=None, name_filter_mode=None) List[rhino_health.lib.endpoints.dataset.dataset_dataclass.LTSDataset]#

Returns Dataset dataclasses

See also

rhino_health.lib.endpoints.dataset.dataset_endpoints.search_for_datasets_by_name
get_data_schemas(project_uid: str) List[rhino_health.lib.endpoints.data_schema.data_schema_dataclass.DataSchema]#

Returns Datashemas associated with the project_uid

get_data_schema_by_name(name, version=VersionMode.LATEST, project_uid=None) rhino_health.lib.endpoints.data_schema.data_schema_dataclass.LTSDataSchema#

Returns DataSchema dataclass

See also

rhino_health.lib.endpoints.data_schema.data_schema_endpoints.get_data_schema_by_name
search_for_data_schemas_by_name(name, version=VersionMode.LATEST, project_uid=None, name_filter_mode=None) List[rhino_health.lib.endpoints.data_schema.data_schema_dataclass.LTSDataSchema]#

Returns DataSchema dataclasses

See also

rhino_health.lib.endpoints.data_schema.data_schema_endpoints.search_for_data_schemas_by_name
get_code_objects(project_uid: str) List[rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObject]#

Returns CodeObjects associated with the project

get_code_object_by_name(name, version=VersionMode.LATEST, project_uid=None) rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObject | None#

Returns the CodeObject

See also

rhino_health.lib.endpoints.code_object.code_object_endpoints.get_code_object_by_name
search_for_code_objects_by_name(name, version=VersionMode.LATEST, project_uid=None, name_filter_mode=None) List[rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObject]#

Returns CodeObject dataclasses

See also

rhino_health.lib.endpoints.code_object.code_object_endpoints.search_for_code_objects_by_name
get_collaborating_workgroups(project_uid: str | rhino_health.lib.endpoints.project.project_dataclass.Project)#
add_collaborator(project_uid: str, collaborating_workgroup_uid: str)#

Adds COLLABORATING_WORKGROUP_UID as a collaborator to PROJECT_UID

Warning

This feature is under development and the interface may change

remove_collaborator(project_uid: str, collaborating_workgroup_uid: str)#

Removes COLLABORATING_WORKGROUP_UID as a collaborator from PROJECT_UID

Warning

This feature is under development and the interface may change

aggregate_dataset_metric(dataset_uids: List[str], metric_configuration: rhino_health.lib.metrics.base_metric.BaseMetric, aggregation_method_override: Callable | None = None) rhino_health.lib.metrics.base_metric.MetricResponse#

Returns the aggregate metric based on the METRIC_CONFIGURATION for a list of datasets.

Parameters:
dataset_uids: List[str]

UIDS for the Datasets to query metrics against

metric_configuration: BaseMetric

Configuration for the metric to be run

aggregation_method_override: Optional[Callable]

A custom function to use to aggregate the results. The method signature should be: method(metric_name: str, metric_results: List[Dict[str, Any]], **kwargs), where the metric_results are each of the Dataset results for the metric, and the method should return a dict with the structure of: {metric_name: <aggregated_value>}.

Returns:
metric_response: MetricResponse

A response object containing the result of the query

See also

rhino_health.lib.metrics

Dataclasses specifying possible metric configurations to send

rhino_health.lib.metrics.base_metric.MetricResponse

Response object

rhino_health.lib.metrics.aggregate_metrics.aggregation_methods

Sample aggregation methods

joined_dataset_metric(configuration: rhino_health.lib.metrics.base_metric.JoinableMetric, query_datasets: List[str], filter_datasets: List[str] | None = None) rhino_health.lib.metrics.base_metric.MetricResponse#

Perform a Federated Join Dataset Metric

Intersection Joins allow filtering against columns in that are present in the filter dataset and then getting metrics from a separate query dataset which do not contain those columns.

Union Joins handles deduplication of results between multiple datasets.

Parameters:
metric_configuration: JoinableMetric

Configuration for the metric to be run

query_datasets: List[str]

UIDS for the dataset(s) to get the query values from. For INTERSECTION mode supports one dataset. For UNION mode supports any number of datasets.

filter_datasets: Optional[List[str]] = None

UIDS for the dataset(s) to perform the join query against. For INTERSECTION mode supports one dataset. For UNION mode this is ignored

Returns:
metric_response: MetricResponse

A response object containing the result of the query