Workspaces

Before You Start


Create & Get Set & Delete
lore.create_workspace lore.set_workspace
lore.get_workspaces() lore.delete_workspace

Creating a Workspace

You can create a new workspace using the following code:

WORKSPACE_NAME = "my-first-workspace"

# Create a new workspace
workspace = lore.create_workspace("WORKSPACE_NAME")

# Set the workspace and project in the lore session
lore.set_workspace(workspace.name)

Loading a Workspace

If you already have a workspace, you can load them using the following code:

WORKSPACE_NAME = "<ADD_WORKSPACE_NAME>"
lore.set_workspace(WORKSPACE_NAME)

Listing all Workspaces

# Retrieve a list of workspaces
workspaces = lore.get_workspaces()

# Iterate through the list and print workspace details
for workspace in workspaces:
    print(f"Workspace ID: {workspace.id}, Workspace Name: {workspace.name}")

Deleting a Workspace

Occasionally, you may want to programmatically delete a workspace. You can do so by passing in the workspace IDs.

WORKSPACE_ID = "<ADD_WORKSPACE_ID>"

lore.delete_workspace(WORKSPACE_ID)