Skip to main content
Version: v3.0.2

Manage workspaces

A workspace groups related feature sets, jobs, drafts, and reviews together.

note

Workspaces replace the legacy Projects concept, which means any workflow that previously used client.projects now uses client.workspaces.

To initialize the client, see Starting the client.

List workspaces​

# Iterate over all workspaces
for workspace in client.workspaces.list():
print(workspace.uid, workspace.name)

# Access by index
first = client.workspaces.list()[0]

# Filter by name
ws = client.workspaces.list(name="default")[0]

# Filter with an AIP-160 expression
ws = client.workspaces.list(query='display_name = "production"')[0]

Count workspaces​

total = client.workspaces.count()

Create a workspace​

workspace = client.workspaces.create(
name="my-workspace",
description="Workspace for the fraud detection project",
)

The user who creates the workspace is automatically granted the owner role.

Parameters

ParameterTypeRequiredDescription
namestrYesDisplay name for the workspace.
descriptionstrNoDescription. Defaults to "".

Returns a Workspace object.

Get a workspace​

# Pass the workspace uid — the identifier part of "workspaces/<uid>"
workspace = client.workspaces.get("ws-abc123")

Workspace properties​

PropertyTypeDescription
uidstrUnique identifier.
namestrDisplay name.
descriptionstrDescription.
created_timedatetimeWhen the workspace was created.
last_modified_timedatetimeWhen the workspace was last updated.
access_levelstr"WORKSPACE_ACCESS_LEVEL_PUBLIC" or "WORKSPACE_ACCESS_LEVEL_PRIVATE".
permission_scopeWorkspacePermissionScopeWhether feature sets inside the workspace are visible to others (see Control workspace access).
feature_setsFeatureSetsFeature sets in this workspace.
draftsFeatureSetDraftsDraft feature sets in this workspace.
reviewsReviewsFeature set reviews in this workspace.
jobsJobsJobs in this workspace.
print(workspace.uid)
print(workspace.name)
print(workspace.description)
print(workspace.created_time)
print(workspace.last_modified_time)

Update a workspace​

Only the fields you pass are updated.

workspace.update(name="fraud-detection-v2")

workspace.update(description="Renamed workspace for fraud detection")

workspace.update(name="fraud-detection-v2", description="Renamed workspace")

# Clear the description
workspace.update(description=None)

Delete a workspace​

workspace.delete()

This deletes all feature sets, features, jobs, and other resources in the workspace.

Working with feature sets​

Access feature sets through the workspace to keep all operations scoped to it.

# List feature sets in a workspace
for fs in workspace.feature_sets.list():
print(fs.name)

# Register a feature set in a workspace
feature_set = workspace.feature_sets.register(schema=schema, feature_set_name="customer_features")

Feedback