jupyter_analysis_tools.datastore.DataStore

class jupyter_analysis_tools.datastore.DataStore(url, username=None, token=None, tokenValidTo=None)[source]

Bases: object

__init__(url, username=None, token=None, tokenValidTo=None)[source]

Initialize the datastore connection and authenticate with openBIS.

Parameters:
  • url (str) – The URL of the openBIS server.

  • username (str, optional) – The username for authentication. Defaults to the current system user if not provided. It will as for the password interactively.

  • token (str, optional) – A personal access token as retrieved by DataStore.token earlier as alternative to username/password authentication.

  • tokenValidTo (str, optional) – The expiration datetime for the new personal access token when it is created using username/password authentication.

Raises:

Exception – If authentication fails or connection to the server cannot be established.

Note

  • If username is not provided, it defaults to the current system user.

  • Password is prompted interactively via getpass.

  • A personal access token named “test-session” is automatically created/retrieved.

  • Token is not persisted to disk.

Methods

__init__(url[, username, token, tokenValidTo])

Initialize the datastore connection and authenticate with openBIS.

createCollection(collName, projectObj[, ...])

createObject(projectName[, collectionName, ...])

createProject(projectName, space[, spacePrefix])

Finds the requested project in the DataStore.

findObjects(*args, **kwargs)

identifier(objects, code)

uploadDataset(obj, datasetType[, fpaths])

Attributes

token

url

userspace

createProject(projectName, space, spacePrefix=None)[source]

Finds the requested project in the DataStore. Matching project names can be limited to a given spacePrefix. If the project is not found, a new project with the given code in the given space is created.