You can interact with the Workspaces through the API.

Basic operations#

Listing workspaces#

workspaces = client.list_workspaces(True)
# Returns a list of DSSWorkspace
for workspace in workspaces:
        # Access to main information in the workspace
        print("Workspace key: %s" % workspace.workspace_key)
        print("Display name: %s" % workspace.get_settings().display_name)
        print("Description: %s" % workspace.get_settings().description)
        print("Permissions: %s" % workspace.get_settings().permissions) # Returns a list of DSSWorkspacePermissionItem
        # You can also list the objects in a workspaces
        print("Objects: %s" % workspace.list_objects())

Modifying workspace#

workspace = client.get_workspace("WORKSPACE_KEY")
settings = workspace.get_settings()
settings.permissions = [*settings.permissions, DSSWorkspacePermissionItem.member_user("LOGIN"), DSSWorkspacePermissionItem.contributor_group("GROUP")]

Deleting a workspace#

workspace = client.get_workspace("WORKSPACE_KEY")

Adding and deleting the objects in a workspace#

workspace = client.get_workspace("WORKSPACE_KEY")
workspace_objects = workspace.list_objects()
for workspace_object in workspace_objects

workspace.add_object(client.get_project("PROJECT_KEY").get_dataset("DATASET_NAME")) # To add a dataset
workspace.add_object(client.get_project("PROJECT_KEY").get_wiki("WIKI").get_article("ARTICLE"))  # To add an article
workspace.add_object(client.get_app("APP_ID")) # To add an app
workspace.add_object({"htmlLink": {"name": "Dataiku", "url": "", "description": "Dataiku website"}}) # You can also specify the content as a dict, here we add a link

Reference documentation#


A handle to interact with a workspace on the DSS instance.


A handle on an object of a workspace


A handle on the settings of a workspace