Skip to main content

Workflow Management

After installing, importing and initializing the Python client, the user is completely set to start utilizing the client's functionalities.

There's more to these functionalities than working with datasets and models; this section explains how to use the TIM Python client to manage and structure the analytics work done with TIM.

get_workspaces - retrieve a list of available workspaces

get_workspaces(self, offset: int = 0, limit: int = 10000, user_group_id: Optional[str] = None, sort: Optional[str] = None) -> List[tim.data_sources.workspace.types.Workspace]

The get_workspaces method retrieves a list of available workspaces from the TIM repository. This method is called on the authenticated instance of Tim created as described in Authentication ("client"), like in the following statement:

client.get_workspaces(offset = <offset>, limit = <limit>, user_group_id = <user group ID>, sort = <sorting order>)

using keyword arguments, or in the following statement:

client.get_workspaces(<offset>, <limit>, <user group ID>, <sorting order>)

using positional arguments, where <offset>, <limit>, <user group ID> and <sorting order> are replaced by the relevant values.

The arguments are:

  • offset: the number of workspaces to be skipped from the beginning of the list (related to pagination), this is an optional argument with a default value of 0,
  • limit: the maximum number of workspaces to be returned, this is an optional argument with a default value of 10000,
  • user_group_id: a filter on the ID of the user group a workspace belongs to, this is an optional argument with a default value of None,
  • sort: a sorting order to sort results by, possible values are "+createdAt" and "-createdAt", where "+" and "-" indicate ascending and descending order, respectively. This is an optional argument with a default value of "-createdAt" (most recently created workspaces are returned first).

This method returns a list of Dictionaries, each of which include the following data:

  • id: the ID of the workspace,
  • name: the name of the workspace,
  • description: the description of the workspace,
  • userGroup: a Dictionary containing the key id, which is assigned the ID of the user group the workspace belongs to,
  • isFavorite: a flag indicating whether this workspace is a favorite,
  • createdAt: the time of creation of this workspace,
  • createdBy: the id of the user who created this workspace,
  • updatedAt: the time of the last update of this workspace (if applicable),
  • updatedBy: the id of the user who last updated this workspace (if applicable).