graviti.manager.tag#

The implementation of the Tag and TagManager.

Module Contents#

Classes#

Tag

This class defines the structure of the tag of a commit.

TagManager

This class defines the operations on the tag in Graviti.

class graviti.manager.tag.Tag(dataset, name, commit_id)[source]#

Bases: graviti.manager.commit.NamedCommit

This class defines the structure of the tag of a commit.

Parameters
class graviti.manager.tag.TagManager(dataset)[source]#

This class defines the operations on the tag in Graviti.

Parameters

dataset (graviti.manager.dataset.Dataset) – Dataset instance.

create(self, name, revision=CURRENT_COMMIT)[source]#

Create a tag for a commit.

Parameters
  • name (str) – The tag name to be created for the specific commit.

  • revision (str) – The information to locate the specific commit, which can be the commit id, the branch name, or the tag name. The default value is the current commit of the dataset.

Raises

NoCommitsError – When create tags on the default branch without commit history.

Returns

The Tag instance with the given name.

Return type

Tag

get(self, name)[source]#

Get the certain tag with the given name.

Parameters

name (str) – The required tag name.

Raises

ResourceNameError – When the name is an empty string.

Returns

The Tag instance with the given name.

Return type

Tag

list(self)[source]#

List the information of tags.

Returns

The LazyPagingList of tags instances.

Return type

graviti.manager.lazy.LazyPagingList[Tag]

delete(self, name)[source]#

Delete a tag.

Parameters

name (str) – The tag name to be deleted for the specific commit.

Raises

ResourceNameError – When the name is an empty string.

Return type

None