rg.Workspace
¶
In Argilla, workspaces are used to organize datasets in to groups. For example, you might have a workspace for each project or team.
Usage Examples¶
To create a new workspace, instantiate the Workspace
object with the client and the name:
To retrieve an existing workspace, use the client.workspaces
attribute:
Class Reference¶
rg.Workspace
¶
Bases: Resource
Class for interacting with Argilla workspaces. Workspaces are used to organize datasets in the Argilla server.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the workspace. |
id |
UUID
|
The ID of the workspace. This is a unique identifier for the workspace in the server. |
datasets |
List[Dataset]
|
A list of all datasets in the workspace. |
users |
WorkspaceUsers
|
A list of all users in the workspace. |
Source code in src/argilla_sdk/workspaces/_resource.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
datasets: List[Dataset]
property
¶
List all datasets in the workspace
Returns:
Type | Description |
---|---|
List[Dataset]
|
List[Dataset]: A list of all datasets in the workspace |
users: WorkspaceUsers
property
¶
List all users in the workspace
Returns:
Name | Type | Description |
---|---|---|
WorkspaceUsers |
WorkspaceUsers
|
A list of all users in the workspace |
__init__(name=None, id=None, client=None, _model=None)
¶
Initializes a Workspace object with a client and a name or id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client |
Argilla
|
The client used to interact with Argilla |
None
|
name |
str
|
The name of the workspace |
None
|
id |
UUID
|
The id of the workspace |
None
|
_model |
WorkspaceModel
|
The internal Pydantic model of the workspace from/to the server |
None
|
Returns: Workspace: The initialized workspace object
Source code in src/argilla_sdk/workspaces/_resource.py
add_user(user)
¶
Adds a user to the workspace. After adding a user to the workspace, it will have access to the datasets in the workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user |
Union[User, str]
|
The user to add to the workspace. Can be a User object or a username. |
required |
Returns:
Name | Type | Description |
---|---|---|
User |
User
|
The user that was added to the workspace |
Source code in src/argilla_sdk/workspaces/_resource.py
exists()
¶
Checks if the workspace exists in the server
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the workspace exists, False otherwise |
remove_user(user)
¶
Removes a user from the workspace. After removing a user from the workspace, it will no longer have access
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user |
Union[User, str]
|
The user to remove from the workspace. Can be a User object or a username. |
required |
Returns:
Name | Type | Description |
---|---|---|
User |
User
|
The user that was removed from the workspace. |