mantlebio.core.dataset.client module#
- class mantlebio.core.dataset.client.DatasetClient(session, storage_client, analysis_id='', pipeline_run_id='')[source]#
Bases:
_IDatasetClient
DatasetClient object for making requests to the Mantle API
- _create_local_dataset(name=None, dataset_type=None, properties=None, origin=None)[source]#
- Return type:
- create(name=None, dataset_type=None, properties=None, local=True, origin=None, entity_type=None)[source]#
Creates a new dataset.
- Parameters:
dataset_type (str, optional) – The type of the dataset. Defaults to None.
properties (Dict[str,Any], optional) – The properties of the dataset. Defaults to None.
local (bool, optional) – Whether the dataset is local. Defaults to True.
origin (entity_pb2.Origin, optional) – The origin of the dataset. Defaults to None.
entity_type (str, optional) – The type of the entity. Defaults to None. This is a deprecated parameter. Will be removed in 2.0.0.
- Returns:
The created dataset.
- Return type:
- get(id)[source]#
Get a dataset by ID
- Parameters:
id (str) – Dataset ID
- Returns:
Dataset object
- Return type:
Dataset
- get_entity(id)[source]#
Get a dataset by ID
- Parameters:
id (str) – Dataset ID
- Returns:
Dataset object
- Return type:
Dataset
- list(query_params={})[source]#
Get a list of datasets
- Returns:
List of Dataset objects
- Return type:
ListResponse[Dataset]
- class mantlebio.core.dataset.client.EntityClient(session, storage_client, analysis_id='', pipeline_run_id='')[source]#
Bases:
DatasetClient
- class mantlebio.core.dataset.client._IDatasetClient(session, storage_client, analysis_id='', pipeline_run_id='')[source]#
Bases:
QueryableClient
Interface for an entity client that interacts with entities in a data storage system.
- abstract create(name=None, dataset_type=None, properties=None, local=True, origin=None, entity_type=None)[source]#
Creates a new dataset.
- Parameters:
dataset_type (str, optional) – The type of the dataset. Defaults to None.
properties (Dict[str,Any], optional) – The properties of the dataset. Defaults to None.
local (bool, optional) – Whether the dataset is local. Defaults to True.
origin (entity_pb2.Origin, optional) – The origin of the dataset. Defaults to None.
entity_type (str, optional) – The type of the entity. Defaults to None. This is a deprecated parameter. Will be removed in 2.0.0.
- Returns:
The created dataset.
- Return type:
- abstract get(id)[source]#
Retrieves an entity by its ID.
- Parameters:
id (str) – The ID of the entity.
- Returns:
The retrieved entity.
- Return type:
- abstract get_datasets()[source]#
Retrieves all datasets.
- Returns:
An Iterable List of all datasets.
- Return type:
- abstract get_entities()[source]#
Retrieves all entities.
- Returns:
An Iterable List of all entities.
- Return type: