label-studio-sdk 2.0.11__py3-none-any.whl → 2.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of label-studio-sdk might be problematic. Click here for more details.
- label_studio_sdk/__init__.py +12 -8
- label_studio_sdk/actions/__init__.py +2 -0
- label_studio_sdk/actions/types/__init__.py +2 -0
- label_studio_sdk/actions/types/actions_list_response_item.py +2 -1
- label_studio_sdk/actions/types/actions_list_response_item_permission.py +5 -0
- label_studio_sdk/core/client_wrapper.py +6 -1
- label_studio_sdk/export_storage/azure/client.py +14 -10
- label_studio_sdk/export_storage/azure_spi/client.py +14 -10
- label_studio_sdk/export_storage/databricks/client.py +14 -10
- label_studio_sdk/export_storage/gcs/client.py +14 -10
- label_studio_sdk/export_storage/gcswif/client.py +14 -10
- label_studio_sdk/export_storage/local/client.py +14 -10
- label_studio_sdk/export_storage/redis/client.py +14 -10
- label_studio_sdk/export_storage/s3/client.py +14 -10
- label_studio_sdk/export_storage/s3s/client.py +14 -10
- label_studio_sdk/import_storage/azure/client.py +14 -10
- label_studio_sdk/import_storage/azure_spi/client.py +14 -10
- label_studio_sdk/import_storage/databricks/client.py +14 -10
- label_studio_sdk/import_storage/gcs/client.py +14 -10
- label_studio_sdk/import_storage/gcswif/client.py +14 -10
- label_studio_sdk/import_storage/local/client.py +14 -10
- label_studio_sdk/import_storage/redis/client.py +14 -10
- label_studio_sdk/import_storage/s3/client.py +14 -10
- label_studio_sdk/import_storage/s3s/client.py +14 -10
- label_studio_sdk/label_interface/control_tags.py +2 -1
- label_studio_sdk/organizations/__init__.py +1 -2
- label_studio_sdk/organizations/client.py +0 -36
- label_studio_sdk/organizations/permissions/client.py +32 -0
- label_studio_sdk/projects/__init__.py +18 -1
- label_studio_sdk/projects/client.py +8 -0
- label_studio_sdk/projects/members/client.py +137 -30
- label_studio_sdk/projects/metrics/custom/client.py +48 -0
- label_studio_sdk/projects/roles/__init__.py +2 -0
- label_studio_sdk/projects/roles/client.py +555 -0
- label_studio_sdk/projects/stats/__init__.py +16 -0
- label_studio_sdk/projects/stats/client.py +626 -0
- label_studio_sdk/projects/stats/types/__init__.py +22 -0
- label_studio_sdk/projects/stats/types/stats_agreement_annotators_response.py +22 -0
- label_studio_sdk/projects/stats/types/stats_users_ground_truth_agreement_response.py +27 -0
- label_studio_sdk/projects/stats/types/stats_users_ground_truth_agreement_response_agreement_value.py +5 -0
- label_studio_sdk/projects/stats/types/stats_users_prediction_agreement_response.py +27 -0
- label_studio_sdk/projects/stats/types/stats_users_prediction_agreement_response_agreement_value.py +5 -0
- label_studio_sdk/projects/stats/types/stats_users_review_score_response.py +35 -0
- label_studio_sdk/projects/stats/types/stats_users_review_score_response_performance_score_value.py +5 -0
- label_studio_sdk/projects/stats/types/stats_users_review_score_response_review_score_value.py +5 -0
- label_studio_sdk/prompts/versions/client.py +24 -0
- label_studio_sdk/tasks/client.py +10 -0
- label_studio_sdk/types/__init__.py +10 -6
- label_studio_sdk/types/activity_log.py +1 -0
- label_studio_sdk/types/all_roles_project_list.py +6 -2
- label_studio_sdk/types/billing_flags.py +1 -1
- label_studio_sdk/types/default_role.py +0 -9
- label_studio_sdk/types/import_api_request.py +5 -0
- label_studio_sdk/types/lse_organization.py +1 -10
- label_studio_sdk/types/lse_project.py +6 -6
- label_studio_sdk/types/lse_project_counts.py +1 -1
- label_studio_sdk/types/lse_project_create.py +5 -1
- label_studio_sdk/types/lse_project_response.py +5 -1
- label_studio_sdk/types/lse_project_update.py +5 -1
- label_studio_sdk/types/lse_task.py +5 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +5 -0
- label_studio_sdk/types/project.py +198 -0
- label_studio_sdk/types/project_member.py +19 -0
- label_studio_sdk/types/project_role.py +35 -0
- label_studio_sdk/types/project_sampling.py +7 -0
- label_studio_sdk/types/project_skip_queue.py +7 -0
- label_studio_sdk/versions/client.py +0 -12
- label_studio_sdk/workspaces/__init__.py +2 -2
- label_studio_sdk/workspaces/client.py +4 -0
- label_studio_sdk/workspaces/projects/__init__.py +2 -0
- label_studio_sdk/workspaces/projects/client.py +352 -0
- {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/METADATA +1 -1
- {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/RECORD +75 -62
- label_studio_sdk/organizations/types/__init__.py +0 -5
- label_studio_sdk/organizations/types/patched_default_role_request_custom_scripts_editable_by.py +0 -7
- label_studio_sdk/types/custom_scripts_editable_by_enum.py +0 -5
- label_studio_sdk/types/default_role_custom_scripts_editable_by.py +0 -7
- label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +0 -7
- {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/LICENSE +0 -0
- {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import pydantic
|
|
6
|
+
import datetime as dt
|
|
7
|
+
from .user_simple import UserSimple
|
|
8
|
+
from .project_sampling import ProjectSampling
|
|
9
|
+
from .project_skip_queue import ProjectSkipQueue
|
|
10
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Project(UncheckedBaseModel):
|
|
14
|
+
"""
|
|
15
|
+
Serializer get numbers from project queryset annotation,
|
|
16
|
+
make sure, that you use correct one(Project.objects.with_counts())
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
color: typing.Optional[str] = None
|
|
20
|
+
config_has_control_tags: bool = pydantic.Field()
|
|
21
|
+
"""
|
|
22
|
+
Flag to detect is project ready for labeling
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
config_suitable_for_bulk_annotation: bool = pydantic.Field()
|
|
26
|
+
"""
|
|
27
|
+
Flag to detect is project ready for bulk annotation
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
control_weights: typing.Optional[typing.Optional[typing.Any]] = None
|
|
31
|
+
created_at: dt.datetime
|
|
32
|
+
created_by: typing.Optional[UserSimple] = pydantic.Field(default=None)
|
|
33
|
+
"""
|
|
34
|
+
Project owner
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
38
|
+
"""
|
|
39
|
+
Project description
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None)
|
|
43
|
+
"""
|
|
44
|
+
Allow annotators to submit empty annotations
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None)
|
|
48
|
+
"""
|
|
49
|
+
Retrieve and display predictions when loading a task
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
expert_instruction: typing.Optional[str] = pydantic.Field(default=None)
|
|
53
|
+
"""
|
|
54
|
+
Labeling instructions in HTML format
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
finished_task_number: int = pydantic.Field()
|
|
58
|
+
"""
|
|
59
|
+
Finished tasks
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
ground_truth_number: int = pydantic.Field()
|
|
63
|
+
"""
|
|
64
|
+
Honeypot annotation number in project
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
id: int
|
|
68
|
+
is_draft: typing.Optional[bool] = pydantic.Field(default=None)
|
|
69
|
+
"""
|
|
70
|
+
Whether or not the project is in the middle of being created
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
is_published: typing.Optional[bool] = pydantic.Field(default=None)
|
|
74
|
+
"""
|
|
75
|
+
Whether or not the project is published to annotators
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
label_config: typing.Optional[str] = pydantic.Field(default=None)
|
|
79
|
+
"""
|
|
80
|
+
Label config in XML format. See more about it in documentation
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
maximum_annotations: typing.Optional[int] = pydantic.Field(default=None)
|
|
84
|
+
"""
|
|
85
|
+
Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True)
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None)
|
|
89
|
+
"""
|
|
90
|
+
Minimum number of completed tasks after which model training is started
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
model_version: typing.Optional[str] = pydantic.Field(default=None)
|
|
94
|
+
"""
|
|
95
|
+
Machine learning model version
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
num_tasks_with_annotations: int = pydantic.Field()
|
|
99
|
+
"""
|
|
100
|
+
Tasks with annotations count
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
organization: typing.Optional[int] = None
|
|
104
|
+
overlap_cohort_percentage: typing.Optional[int] = None
|
|
105
|
+
parsed_label_config: typing.Optional[typing.Any] = None
|
|
106
|
+
pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
|
|
107
|
+
"""
|
|
108
|
+
Pinned date and time
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
queue_done: int
|
|
112
|
+
queue_total: int
|
|
113
|
+
reveal_preannotations_interactively: typing.Optional[bool] = pydantic.Field(default=None)
|
|
114
|
+
"""
|
|
115
|
+
Reveal pre-annotations interactively
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
sampling: typing.Optional[ProjectSampling] = None
|
|
119
|
+
show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None)
|
|
120
|
+
"""
|
|
121
|
+
Show annotation history to annotator
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None)
|
|
125
|
+
"""
|
|
126
|
+
If set, the annotator can view model predictions
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
show_ground_truth_first: typing.Optional[bool] = pydantic.Field(default=None)
|
|
130
|
+
"""
|
|
131
|
+
Onboarding mode (true): show ground truth tasks first in the labeling stream
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
show_instruction: typing.Optional[bool] = pydantic.Field(default=None)
|
|
135
|
+
"""
|
|
136
|
+
Show instructions to the annotator before they start
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
show_overlap_first: typing.Optional[bool] = None
|
|
140
|
+
show_skip_button: typing.Optional[bool] = pydantic.Field(default=None)
|
|
141
|
+
"""
|
|
142
|
+
Show a skip button in interface and allow annotators to skip the task
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
skip_queue: typing.Optional[ProjectSkipQueue] = None
|
|
146
|
+
skipped_annotations_number: int = pydantic.Field()
|
|
147
|
+
"""
|
|
148
|
+
Skipped by collaborators annotation number in project
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
start_training_on_annotation_update: bool = pydantic.Field()
|
|
152
|
+
"""
|
|
153
|
+
Start model training after any annotations are submitted or updated
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
task_data_login: typing.Optional[str] = pydantic.Field(default=None)
|
|
157
|
+
"""
|
|
158
|
+
Task data credentials: login
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
task_data_password: typing.Optional[str] = pydantic.Field(default=None)
|
|
162
|
+
"""
|
|
163
|
+
Task data credentials: password
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
task_number: int = pydantic.Field()
|
|
167
|
+
"""
|
|
168
|
+
Total task number in project
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
title: typing.Optional[str] = pydantic.Field(default=None)
|
|
172
|
+
"""
|
|
173
|
+
Project name. Must be between 3 and 50 characters long.
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
total_annotations_number: int = pydantic.Field()
|
|
177
|
+
"""
|
|
178
|
+
Total annotations number in project including skipped_annotations_number and ground_truth_number.
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
total_predictions_number: int = pydantic.Field()
|
|
182
|
+
"""
|
|
183
|
+
Total predictions number in project including skipped_annotations_number, ground_truth_number, and useful_annotation_number.
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
useful_annotation_number: int = pydantic.Field()
|
|
187
|
+
"""
|
|
188
|
+
Useful annotation number in project not including skipped_annotations_number and ground_truth_number. Total annotations = annotation_number + skipped_annotations_number + ground_truth_number
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
if IS_PYDANTIC_V2:
|
|
192
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
193
|
+
else:
|
|
194
|
+
|
|
195
|
+
class Config:
|
|
196
|
+
frozen = True
|
|
197
|
+
smart_union = True
|
|
198
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
|
+
import typing
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ProjectMember(UncheckedBaseModel):
|
|
10
|
+
user: int
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
14
|
+
else:
|
|
15
|
+
|
|
16
|
+
class Config:
|
|
17
|
+
frozen = True
|
|
18
|
+
smart_union = True
|
|
19
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
from .role9e7enum import Role9E7Enum
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import typing
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ProjectRole(UncheckedBaseModel):
|
|
11
|
+
id: int
|
|
12
|
+
project: int
|
|
13
|
+
role: Role9E7Enum = pydantic.Field()
|
|
14
|
+
"""
|
|
15
|
+
User role in project
|
|
16
|
+
|
|
17
|
+
* `OW` - Owner
|
|
18
|
+
* `AD` - Administrator
|
|
19
|
+
* `MA` - Manager
|
|
20
|
+
* `RE` - Reviewer
|
|
21
|
+
* `AN` - Annotator
|
|
22
|
+
* `DI` - Deactivated
|
|
23
|
+
* `NO` - Not Activated
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
user: int
|
|
27
|
+
|
|
28
|
+
if IS_PYDANTIC_V2:
|
|
29
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
30
|
+
else:
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
frozen = True
|
|
34
|
+
smart_union = True
|
|
35
|
+
extra = pydantic.Extra.allow
|
|
@@ -16,12 +16,6 @@ class VersionsClient:
|
|
|
16
16
|
|
|
17
17
|
def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> VersionResponse:
|
|
18
18
|
"""
|
|
19
|
-
<Card href="https://humansignal.com/goenterprise">
|
|
20
|
-
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
21
|
-
<p style="margin-top: 10px; font-size: 14px;">
|
|
22
|
-
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
23
|
-
</p>
|
|
24
|
-
</Card>
|
|
25
19
|
Get version information about the Label Studio instance.
|
|
26
20
|
|
|
27
21
|
Parameters
|
|
@@ -69,12 +63,6 @@ class AsyncVersionsClient:
|
|
|
69
63
|
|
|
70
64
|
async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> VersionResponse:
|
|
71
65
|
"""
|
|
72
|
-
<Card href="https://humansignal.com/goenterprise">
|
|
73
|
-
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
74
|
-
<p style="margin-top: 10px; font-size: 14px;">
|
|
75
|
-
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
76
|
-
</p>
|
|
77
|
-
</Card>
|
|
78
66
|
Get version information about the Label Studio instance.
|
|
79
67
|
|
|
80
68
|
Parameters
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from .members.client import MembersClient
|
|
6
|
+
from .projects.client import ProjectsClient
|
|
6
7
|
from ..core.request_options import RequestOptions
|
|
7
8
|
from ..types.workspace import Workspace
|
|
8
9
|
from ..core.unchecked_base_model import construct_type
|
|
@@ -11,6 +12,7 @@ from ..core.api_error import ApiError
|
|
|
11
12
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
12
13
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
13
14
|
from .members.client import AsyncMembersClient
|
|
15
|
+
from .projects.client import AsyncProjectsClient
|
|
14
16
|
|
|
15
17
|
# this is used as the default value for optional parameters
|
|
16
18
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -20,6 +22,7 @@ class WorkspacesClient:
|
|
|
20
22
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
23
|
self._client_wrapper = client_wrapper
|
|
22
24
|
self.members = MembersClient(client_wrapper=self._client_wrapper)
|
|
25
|
+
self.projects = ProjectsClient(client_wrapper=self._client_wrapper)
|
|
23
26
|
|
|
24
27
|
def list(
|
|
25
28
|
self,
|
|
@@ -358,6 +361,7 @@ class AsyncWorkspacesClient:
|
|
|
358
361
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
359
362
|
self._client_wrapper = client_wrapper
|
|
360
363
|
self.members = AsyncMembersClient(client_wrapper=self._client_wrapper)
|
|
364
|
+
self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
|
|
361
365
|
|
|
362
366
|
async def list(
|
|
363
367
|
self,
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from ...core.client_wrapper import SyncClientWrapper
|
|
5
|
+
from ...core.request_options import RequestOptions
|
|
6
|
+
from ...types.project import Project
|
|
7
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
|
8
|
+
from ...core.unchecked_base_model import construct_type
|
|
9
|
+
from json.decoder import JSONDecodeError
|
|
10
|
+
from ...core.api_error import ApiError
|
|
11
|
+
from ...core.client_wrapper import AsyncClientWrapper
|
|
12
|
+
|
|
13
|
+
# this is used as the default value for optional parameters
|
|
14
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ProjectsClient:
|
|
18
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
19
|
+
self._client_wrapper = client_wrapper
|
|
20
|
+
|
|
21
|
+
def list(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Project]:
|
|
22
|
+
"""
|
|
23
|
+
<Card href="https://humansignal.com/goenterprise">
|
|
24
|
+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
25
|
+
<p style="margin-top: 10px; font-size: 14px;">
|
|
26
|
+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
27
|
+
</p>
|
|
28
|
+
</Card>
|
|
29
|
+
Retrieve a list of all projects in a specific workspace.
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
id : int
|
|
34
|
+
|
|
35
|
+
request_options : typing.Optional[RequestOptions]
|
|
36
|
+
Request-specific configuration.
|
|
37
|
+
|
|
38
|
+
Returns
|
|
39
|
+
-------
|
|
40
|
+
typing.List[Project]
|
|
41
|
+
Projects list
|
|
42
|
+
|
|
43
|
+
Examples
|
|
44
|
+
--------
|
|
45
|
+
from label_studio_sdk import LabelStudio
|
|
46
|
+
|
|
47
|
+
client = LabelStudio(
|
|
48
|
+
api_key="YOUR_API_KEY",
|
|
49
|
+
)
|
|
50
|
+
client.workspaces.projects.list(
|
|
51
|
+
id=1,
|
|
52
|
+
)
|
|
53
|
+
"""
|
|
54
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
55
|
+
f"api/workspaces/{jsonable_encoder(id)}/projects/",
|
|
56
|
+
method="GET",
|
|
57
|
+
request_options=request_options,
|
|
58
|
+
)
|
|
59
|
+
try:
|
|
60
|
+
if 200 <= _response.status_code < 300:
|
|
61
|
+
return typing.cast(
|
|
62
|
+
typing.List[Project],
|
|
63
|
+
construct_type(
|
|
64
|
+
type_=typing.List[Project], # type: ignore
|
|
65
|
+
object_=_response.json(),
|
|
66
|
+
),
|
|
67
|
+
)
|
|
68
|
+
_response_json = _response.json()
|
|
69
|
+
except JSONDecodeError:
|
|
70
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
71
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
72
|
+
|
|
73
|
+
def add(self, id: int, *, project: int, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
74
|
+
"""
|
|
75
|
+
<Card href="https://humansignal.com/goenterprise">
|
|
76
|
+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
77
|
+
<p style="margin-top: 10px; font-size: 14px;">
|
|
78
|
+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
79
|
+
</p>
|
|
80
|
+
</Card>
|
|
81
|
+
Add a project to a specific workspace.
|
|
82
|
+
|
|
83
|
+
Parameters
|
|
84
|
+
----------
|
|
85
|
+
id : int
|
|
86
|
+
|
|
87
|
+
project : int
|
|
88
|
+
|
|
89
|
+
request_options : typing.Optional[RequestOptions]
|
|
90
|
+
Request-specific configuration.
|
|
91
|
+
|
|
92
|
+
Returns
|
|
93
|
+
-------
|
|
94
|
+
None
|
|
95
|
+
|
|
96
|
+
Examples
|
|
97
|
+
--------
|
|
98
|
+
from label_studio_sdk import LabelStudio
|
|
99
|
+
|
|
100
|
+
client = LabelStudio(
|
|
101
|
+
api_key="YOUR_API_KEY",
|
|
102
|
+
)
|
|
103
|
+
client.workspaces.projects.add(
|
|
104
|
+
id=1,
|
|
105
|
+
project=1,
|
|
106
|
+
)
|
|
107
|
+
"""
|
|
108
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
109
|
+
f"api/workspaces/{jsonable_encoder(id)}/projects/",
|
|
110
|
+
method="POST",
|
|
111
|
+
json={
|
|
112
|
+
"project": project,
|
|
113
|
+
},
|
|
114
|
+
headers={
|
|
115
|
+
"content-type": "application/json",
|
|
116
|
+
},
|
|
117
|
+
request_options=request_options,
|
|
118
|
+
omit=OMIT,
|
|
119
|
+
)
|
|
120
|
+
try:
|
|
121
|
+
if 200 <= _response.status_code < 300:
|
|
122
|
+
return
|
|
123
|
+
_response_json = _response.json()
|
|
124
|
+
except JSONDecodeError:
|
|
125
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
126
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
127
|
+
|
|
128
|
+
def remove(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
129
|
+
"""
|
|
130
|
+
<Card href="https://humansignal.com/goenterprise">
|
|
131
|
+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
132
|
+
<p style="margin-top: 10px; font-size: 14px;">
|
|
133
|
+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
134
|
+
</p>
|
|
135
|
+
</Card>
|
|
136
|
+
Remove a project from a specific workspace.
|
|
137
|
+
|
|
138
|
+
Parameters
|
|
139
|
+
----------
|
|
140
|
+
id : int
|
|
141
|
+
|
|
142
|
+
request_options : typing.Optional[RequestOptions]
|
|
143
|
+
Request-specific configuration.
|
|
144
|
+
|
|
145
|
+
Returns
|
|
146
|
+
-------
|
|
147
|
+
None
|
|
148
|
+
|
|
149
|
+
Examples
|
|
150
|
+
--------
|
|
151
|
+
from label_studio_sdk import LabelStudio
|
|
152
|
+
|
|
153
|
+
client = LabelStudio(
|
|
154
|
+
api_key="YOUR_API_KEY",
|
|
155
|
+
)
|
|
156
|
+
client.workspaces.projects.remove(
|
|
157
|
+
id=1,
|
|
158
|
+
)
|
|
159
|
+
"""
|
|
160
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
161
|
+
f"api/workspaces/{jsonable_encoder(id)}/projects/",
|
|
162
|
+
method="DELETE",
|
|
163
|
+
request_options=request_options,
|
|
164
|
+
)
|
|
165
|
+
try:
|
|
166
|
+
if 200 <= _response.status_code < 300:
|
|
167
|
+
return
|
|
168
|
+
_response_json = _response.json()
|
|
169
|
+
except JSONDecodeError:
|
|
170
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
171
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class AsyncProjectsClient:
|
|
175
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
176
|
+
self._client_wrapper = client_wrapper
|
|
177
|
+
|
|
178
|
+
async def list(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Project]:
|
|
179
|
+
"""
|
|
180
|
+
<Card href="https://humansignal.com/goenterprise">
|
|
181
|
+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
182
|
+
<p style="margin-top: 10px; font-size: 14px;">
|
|
183
|
+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
184
|
+
</p>
|
|
185
|
+
</Card>
|
|
186
|
+
Retrieve a list of all projects in a specific workspace.
|
|
187
|
+
|
|
188
|
+
Parameters
|
|
189
|
+
----------
|
|
190
|
+
id : int
|
|
191
|
+
|
|
192
|
+
request_options : typing.Optional[RequestOptions]
|
|
193
|
+
Request-specific configuration.
|
|
194
|
+
|
|
195
|
+
Returns
|
|
196
|
+
-------
|
|
197
|
+
typing.List[Project]
|
|
198
|
+
Projects list
|
|
199
|
+
|
|
200
|
+
Examples
|
|
201
|
+
--------
|
|
202
|
+
import asyncio
|
|
203
|
+
|
|
204
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
205
|
+
|
|
206
|
+
client = AsyncLabelStudio(
|
|
207
|
+
api_key="YOUR_API_KEY",
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
async def main() -> None:
|
|
212
|
+
await client.workspaces.projects.list(
|
|
213
|
+
id=1,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
asyncio.run(main())
|
|
218
|
+
"""
|
|
219
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
220
|
+
f"api/workspaces/{jsonable_encoder(id)}/projects/",
|
|
221
|
+
method="GET",
|
|
222
|
+
request_options=request_options,
|
|
223
|
+
)
|
|
224
|
+
try:
|
|
225
|
+
if 200 <= _response.status_code < 300:
|
|
226
|
+
return typing.cast(
|
|
227
|
+
typing.List[Project],
|
|
228
|
+
construct_type(
|
|
229
|
+
type_=typing.List[Project], # type: ignore
|
|
230
|
+
object_=_response.json(),
|
|
231
|
+
),
|
|
232
|
+
)
|
|
233
|
+
_response_json = _response.json()
|
|
234
|
+
except JSONDecodeError:
|
|
235
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
236
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
237
|
+
|
|
238
|
+
async def add(self, id: int, *, project: int, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
239
|
+
"""
|
|
240
|
+
<Card href="https://humansignal.com/goenterprise">
|
|
241
|
+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
242
|
+
<p style="margin-top: 10px; font-size: 14px;">
|
|
243
|
+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
244
|
+
</p>
|
|
245
|
+
</Card>
|
|
246
|
+
Add a project to a specific workspace.
|
|
247
|
+
|
|
248
|
+
Parameters
|
|
249
|
+
----------
|
|
250
|
+
id : int
|
|
251
|
+
|
|
252
|
+
project : int
|
|
253
|
+
|
|
254
|
+
request_options : typing.Optional[RequestOptions]
|
|
255
|
+
Request-specific configuration.
|
|
256
|
+
|
|
257
|
+
Returns
|
|
258
|
+
-------
|
|
259
|
+
None
|
|
260
|
+
|
|
261
|
+
Examples
|
|
262
|
+
--------
|
|
263
|
+
import asyncio
|
|
264
|
+
|
|
265
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
266
|
+
|
|
267
|
+
client = AsyncLabelStudio(
|
|
268
|
+
api_key="YOUR_API_KEY",
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
async def main() -> None:
|
|
273
|
+
await client.workspaces.projects.add(
|
|
274
|
+
id=1,
|
|
275
|
+
project=1,
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
asyncio.run(main())
|
|
280
|
+
"""
|
|
281
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
282
|
+
f"api/workspaces/{jsonable_encoder(id)}/projects/",
|
|
283
|
+
method="POST",
|
|
284
|
+
json={
|
|
285
|
+
"project": project,
|
|
286
|
+
},
|
|
287
|
+
headers={
|
|
288
|
+
"content-type": "application/json",
|
|
289
|
+
},
|
|
290
|
+
request_options=request_options,
|
|
291
|
+
omit=OMIT,
|
|
292
|
+
)
|
|
293
|
+
try:
|
|
294
|
+
if 200 <= _response.status_code < 300:
|
|
295
|
+
return
|
|
296
|
+
_response_json = _response.json()
|
|
297
|
+
except JSONDecodeError:
|
|
298
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
299
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
300
|
+
|
|
301
|
+
async def remove(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
302
|
+
"""
|
|
303
|
+
<Card href="https://humansignal.com/goenterprise">
|
|
304
|
+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
|
|
305
|
+
<p style="margin-top: 10px; font-size: 14px;">
|
|
306
|
+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
|
|
307
|
+
</p>
|
|
308
|
+
</Card>
|
|
309
|
+
Remove a project from a specific workspace.
|
|
310
|
+
|
|
311
|
+
Parameters
|
|
312
|
+
----------
|
|
313
|
+
id : int
|
|
314
|
+
|
|
315
|
+
request_options : typing.Optional[RequestOptions]
|
|
316
|
+
Request-specific configuration.
|
|
317
|
+
|
|
318
|
+
Returns
|
|
319
|
+
-------
|
|
320
|
+
None
|
|
321
|
+
|
|
322
|
+
Examples
|
|
323
|
+
--------
|
|
324
|
+
import asyncio
|
|
325
|
+
|
|
326
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
327
|
+
|
|
328
|
+
client = AsyncLabelStudio(
|
|
329
|
+
api_key="YOUR_API_KEY",
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
async def main() -> None:
|
|
334
|
+
await client.workspaces.projects.remove(
|
|
335
|
+
id=1,
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
asyncio.run(main())
|
|
340
|
+
"""
|
|
341
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
342
|
+
f"api/workspaces/{jsonable_encoder(id)}/projects/",
|
|
343
|
+
method="DELETE",
|
|
344
|
+
request_options=request_options,
|
|
345
|
+
)
|
|
346
|
+
try:
|
|
347
|
+
if 200 <= _response.status_code < 300:
|
|
348
|
+
return
|
|
349
|
+
_response_json = _response.json()
|
|
350
|
+
except JSONDecodeError:
|
|
351
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
352
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|