Welcome to labstepPy’s documentation!

Installation

pip install labstep

Example Usage

Available Methods

labstep.addComment(user, entity, comment)

Add a comment to a labstep entity such as an experiment or resource.

Parameters:
  • user (obj) – The labstep user to comment as. Must have property ‘api_key’. See ‘login’.
  • entity (obj) – The labstep entity to comment on. Must have ‘thread’ property with property ‘id’.
  • comment (str) – The body of the comment
Returns:

An object representing a comment on labstep.

Return type:

comment

labstep.addTagTo(user, entity, tag)

Attach an existing tag to a Labstep entity. (See ‘tag’ for simplified tagging).

Parameters:
  • user (obj) – The labstep user to comment as. Must have property ‘api_key’. See ‘login’.
  • entity (obj) – The labstep entity to tag. Can be Resource, Experiment or Protocol. Must have ‘id’.
  • tag (str) – The tag to attach. Must have an ‘id’ property.
Returns:

Returns the tagged entity.

Return type:

entity

labstep.attachFile(user, entity, filepath, caption)

Attach a file to a labstep entity such as an experiment or resource. Optionally include a cpation describing the file.

Parameters:
  • user (obj) – The labstep user to attach as. Must have property ‘api_key’. See ‘login’.
  • entity (obj) – The labstep entity to attach to. Must have ‘thread’ property with property ‘id’.
  • filepath (str) – The filepath to the file to attach
  • caption (str) – An optional caption for the file.
Returns:

An object representing a comment on labstep.

Return type:

comment

labstep.attachProtocol(user, experiment, protocol)

Attach a Labstep Protocol to a Labstep Experiment

Parameters:
  • experiment (obj) – The labstep experiment to attach the protocol to. Must have property ‘id’.
  • protocol – The labstep protocol to attach. Must have property ‘id’.
Returns:

An object representing the updated labstep experiment.

Return type:

experiment

labstep.createExperiment(user, name, description=None)

Create a new Labstep Experiment

Parameters:
  • user (obj) – The Labstep user creating the experiment. Must have property ‘api_key’. See ‘login’.
  • name (str) – Give your experiment a name.
  • description – Give your experiment a description.
Returns:

An object representing the new labstep experiment.

Return type:

experiment

labstep.createProject(user, name)

Create a new Labstep Project

Parameters:
  • user (obj) – The Labstep user creating the project. Must have property ‘api_key’. See ‘login’.
  • name (str) – Give your project a name.
Returns:

An object representing the new Labstep project.

Return type:

project

labstep.createProtocol(user, name)

Create a new Labstep Protocol

Parameters:
  • user (obj) – The Labstep user creating the protocol. Must have property ‘api_key’. See ‘login’.
  • name (str) – Give your protocol a name.
Returns:

An object representing the new Labstep Protocol.

Return type:

protocol

labstep.createResource(user, name)

Create a new Labstep Resource

Parameters:
  • user (obj) – The Labstep user creating the protocol. Must have property ‘api_key’. See ‘login’.
  • name (str) – Give your resource a name.
Returns:

An object representing the new Labstep Resource.

Return type:

protocol

labstep.createTag(user, name)

Create a new tag

Parameters:
  • user (obj) – The Labstep user creating the tag. Must have property ‘api_key’. See ‘login’.
  • name (str) – Name of the tag.
Returns:

An object representing the new Labstep tag.

Return type:

tag

labstep.getExperiment(user, id)

Retrieve a specific Labstep Experiment.

Parameters:
  • user (obj) – The Labstep user. Must have property ‘api_key’. See ‘login’.
  • id (int) – The id of the Experiment to retrieve.
Returns:

An object representing a Labstep Experiment.

Return type:

experiment

labstep.getExperiments(user, count=100)

Retrieve a list of a users Experiments on Labstep.

Parameters:
  • user (obj) – The Labstep user whose Experiments you want to retrieve. Must have property ‘api_key’. See ‘login’.
  • count (int) – The number of Experiments to retrieve.
Returns:

A list of experiment objects.

Return type:

experiment

labstep.getProject(user, id)

Retrieve a specific Labstep Project.

Parameters:
  • user (obj) – The Labstep user. Must have property ‘api_key’. See ‘login’.
  • id (int) – The id of the Project to retrieve.
Returns:

An object representing a Labstep Project.

Return type:

project

labstep.getProtocol(user, id)

Retrieve a specific Labstep Protocol.

Parameters:
  • user (obj) – The Labstep user. Must have property ‘api_key’. See ‘login’.
  • id (int) – The id of the Protocol to retrieve.
Returns:

An object representing a Labstep Protocol.

Return type:

protocol

labstep.getProtocols(user, count=100)

Retrieve a list of a users Protocols on Labstep.

Parameters:
  • user (obj) – The Labstep user whose Protocols you want to retrieve. Must have property ‘api_key’. See ‘login’.
  • count (int) – The number of Protocols to retrieve.
Returns:

A list of Protocol objects.

Return type:

protocols

labstep.getResource(user, id)

Retrieve a specific Labstep Resource.

Parameters:
  • user (obj) – The Labstep user. Must have property ‘api_key’. See ‘login’.
  • id (int) – The id of the Resource to retrieve.
Returns:

An object representing a Labstep Resource.

Return type:

resource

labstep.getResources(user, count=100)

Retrieve a list of a users Resources on Labstep.

Parameters:
  • user (obj) – The Labstep user whose Resources you want to retrieve. Must have property ‘api_key’. See ‘login’.
  • count (int) – The number of Resources to retrieve.
Returns:

A list of resource objects.

Return type:

resources

labstep.getTags(user, name=None, count=1000)

Retrieve a list of user tags.

Parameters:
  • user (obj) – The labstep user to comment as. Must have property ‘api_key’. See ‘login’.
  • name (str) – Search for tags with a specific name.
  • count (int) – Total number of results to return. Defaults to 1000.
Returns:

A list of tags matching the search query.

Return type:

tags

labstep.login(username, password)

Returns an authenticated labstep User object to allow you to interact with the labstep API.

Parameters:
  • username (str) – You labstep username
  • password (obj) – Your labstep password
Returns:

An object representing a user on labstep.

Return type:

user

labstep.tag(user, entity, name)

Simple tagging of a Labstep entity (creates a new tag if none exists)

Parameters:
  • user (obj) – The labstep user to comment as. Must have property ‘api_key’. See ‘login’.
  • entity (obj) – The labstep entity to tag. Can be Resource, Experiment or Protocol. Must have ‘id’.
  • name (str) – The name of the tag to add / create.
Returns:

Returns the tagged entity.

Return type:

entity

Indices and tables