Collection

class labstep.entities.collection.model.Collection(data, user)

Represents a Collection on Labstep.

To see all attributes of a collection run

print(my_collection)

Specific attributes can be accessed via dot notation like so…

print(my_collection.name)
print(my_collection.id)
edit(name=OPTIONAL, extraParams={})

Edit the name of an existing Collection.

Parameters:

name (str) – The new name of the Collection.

Returns:

An object representing the edited Collection.

Return type:

Collection

Example

# Get all collections, since there is no function
# to get one collection.
collections = user.getCollections()

# Select the collection by using python index.
collections[1].edit(name='A New Collection Name')
delete()

Delete an existing collection.

Parameters:

collection (obj) – The collection to delete.

Returns:

An object representing the collection to delete.

Return type:

collection

getSubCollections()

Get a list of the sub-collections within the collection.

Returns:

A list of sub-collections

Return type:

List[Collection]

addSubCollections(names)

Add a sub-collection sub-collections to the collection.

Parameters:

name (List[str]) – List of names of sub-collections name of the new sub-collection.

Returns:

An object representing the collection created.

Return type:

Collection