Dataset¶
- class verta.dataset.entities.Dataset(conn, conf, msg)¶
Object representing a ModelDB dataset.
Changed in version 0.16.0: The dataset versioning interface was updated for flexibility, robustness, and consistency with other ModelDB entities.
This class provides read/write functionality for dataset metadata and access to its versions.
There should not be a need to instantiate this class directly; please use
Client.create_dataset()
.- Variables:
id (str) – ID of this dataset.
name (str) – Name of this dataset.
url (str) – Verta web app URL.
workspace (str) – Workspace containing this dataset.
versions (
DatasetVersions
) – Versions of this dataset.
- add_attribute(key, value)¶
Adds an attribute to this dataset.
- add_attributes(attrs)¶
Adds potentially multiple attributes to this dataset.
- create_version(content, desc=None, tags=None, attrs=None, date_created=None)¶
Creates a dataset version.
- Parameters:
- Returns:
Examples
from verta.dataset import Path version = dataset.create_version(Path("data.csv"))
- del_attribute(key)¶
Deletes the attribute with name key from this dataset.
This method will not raise an error if the attribute does not exist.
- Parameters:
key (str) – Name of the attribute.
- del_tag(tag)¶
Deletes a tag from this dataset.
This method will not raise an error if the tag does not exist.
- Parameters:
tag (str) – Tag to delete.
- delete()¶
Deletes this dataset.
- get_attribute(key)¶
Gets the attribute with name key from this dataset.
- Parameters:
key (str) – Name of the attribute.
- Returns:
one of {None, bool, float, int, str} – Value of the attribute.
- get_attributes()¶
Gets all attributes from this dataset.
- Returns:
dict of str to {None, bool, float, int, str} – Names and values of all attributes.
- get_description()¶
Gets the description of this dataset.
- Returns:
str – Description of this dataset.
- get_latest_version()¶
Gets the latest dataset version.
- Returns:
- get_tags()¶
Gets all tags from this dataset.
- Returns:
list of str – All tags.