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_cloud_dataset(dataset_type, properties=None, origin=None, name=None)[source]#
Return type:

_IDataset

_create_local_dataset(name=None, dataset_type=None, properties=None, origin=None)[source]#
Return type:

_IDataset

build_query()[source]#
Return type:

QueryBuilder

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:

_IDataset

create_cloud_entity(entity_type, properties=None)[source]#
Return type:

_IDataset

create_empty_entity()[source]#
create_local_entity(entity_type=None, properties=None)[source]#
Return type:

_IDataset

get(id)[source]#

Get a dataset by ID

Parameters:

id (str) – Dataset ID

Returns:

Dataset object

Return type:

Dataset

get_datasets()[source]#

Get a list of Datasets

Returns:

List of Dataset objects

Return type:

list

get_entities()[source]#

Get a list of Datasets

Returns:

List of Dataset objects

Return type:

list

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:

_IDataset

abstract get(id)[source]#

Retrieves an entity by its ID.

Parameters:

id (str) – The ID of the entity.

Returns:

The retrieved entity.

Return type:

_IEntity

abstract get_datasets()[source]#

Retrieves all datasets.

Returns:

An Iterable List of all datasets.

Return type:

ListResponse[_IDataset]

abstract get_entities()[source]#

Retrieves all entities.

Returns:

An Iterable List of all entities.

Return type:

ListResponse[_IEntity]

abstract list()[source]#

Retrieves all datasets.

Returns:

An Iterable List of all datasets.

Return type:

ListResponse[_IDataset]