Data

Properties

  • datalake_id UUID of Datalake where this Data is

  • object_name Object name of this Data

  • filename Filename of this Data

  • large If true, this Data file is considered large

  • type Type of this Data

  • width Width of this Data

  • height Height of this Data if this is an Image.

  • duration Duration of this Data if this is a Video.


Methods

reset_url

reset_url()

Description

Reset url of this object


add_tags

add_tags(
   tags: Union[Tag, List[Tag]]
)

Description

Add some tags to an object.
It can be used on Data/MultiData/Asset/MultiAsset/DatasetVersion/Dataset/Model/ModelVersion.

You can give a Tag or a list of Tag.

Examples

tag_bicycle = client.create_tag("bicycle", Target.DATA)
tag_car = client.create_tag("car", Target.DATA)
tag_truck = client.create_tag("truck", Target.DATA)

data.add_tags(tag_bicycle)
data.add_tags([tag_car, tag_truck])

reset_url

reset_url()

Description

Reset url property of this Data by calling platform.

Returns

A url as a string of this Data.


get_tags

get_tags()

Description

Retrieve the tags of your data.

Examples

tags = data.get_tags()
assert tags[0].name == "bicycle"

Returns

List of tags as Tag


get_datasource

get_datasource()

Description

Retrieve DataSource of this Data if it exists. Else, will return None.

Returns

A DataSource object or None.


delete

delete()

Description

Delete data and remove it from datalake.

:warning: DANGER ZONE: Be very careful here!

Remove this data from datalake, and all assets linked to this data.

Examples

data.delete()

Properties


Methods

add_tags

add_tags(
   tags: Union[Tag, List[Tag]]
)

Description

Add some tags to an object.
It can be used on Data/MultiData/Asset/MultiAsset/DatasetVersion/Dataset/Model/ModelVersion.

You can give a Tag or a list of Tag.

Examples

tag_bicycle = client.create_tag("bicycle", Target.DATA)
tag_car = client.create_tag("car", Target.DATA)
tag_truck = client.create_tag("truck", Target.DATA)

data.add_tags(tag_bicycle)
data.add_tags([tag_car, tag_truck])

copy

copy()

Description


split

split(
   ratio: float
)

Description


delete

delete()

Description

Delete a bunch of data and remove them from datalake.

:warning: DANGER ZONE: Be very careful here!

Remove a bunch of data from datalake, and all assets linked to each data.

Examples

whole_data = datalake.list_data(limit=3)
whole_data.delete()

download

download(
   target_path: Union[str, Path] = './', force_replace: bool = False,
   max_workers: Optional[int] = None
)

Description

Download this multi data in given target path

Examples

bunch_of_data = client.get_datalake().list_data(limit=25)
bunch_of_data.download('./downloads/')

Arguments

  • target_path (str or Path, optional) : Target path where to download. Defaults to './'.

  • force_replace : (bool, optional): Replace an existing file if exists. Defaults to False.

  • max_workers (int, optional) : Number of max workers used to download. Defaults to os.cpu_count() + 4.