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.

Files changed (80) hide show
  1. label_studio_sdk/__init__.py +12 -8
  2. label_studio_sdk/actions/__init__.py +2 -0
  3. label_studio_sdk/actions/types/__init__.py +2 -0
  4. label_studio_sdk/actions/types/actions_list_response_item.py +2 -1
  5. label_studio_sdk/actions/types/actions_list_response_item_permission.py +5 -0
  6. label_studio_sdk/core/client_wrapper.py +6 -1
  7. label_studio_sdk/export_storage/azure/client.py +14 -10
  8. label_studio_sdk/export_storage/azure_spi/client.py +14 -10
  9. label_studio_sdk/export_storage/databricks/client.py +14 -10
  10. label_studio_sdk/export_storage/gcs/client.py +14 -10
  11. label_studio_sdk/export_storage/gcswif/client.py +14 -10
  12. label_studio_sdk/export_storage/local/client.py +14 -10
  13. label_studio_sdk/export_storage/redis/client.py +14 -10
  14. label_studio_sdk/export_storage/s3/client.py +14 -10
  15. label_studio_sdk/export_storage/s3s/client.py +14 -10
  16. label_studio_sdk/import_storage/azure/client.py +14 -10
  17. label_studio_sdk/import_storage/azure_spi/client.py +14 -10
  18. label_studio_sdk/import_storage/databricks/client.py +14 -10
  19. label_studio_sdk/import_storage/gcs/client.py +14 -10
  20. label_studio_sdk/import_storage/gcswif/client.py +14 -10
  21. label_studio_sdk/import_storage/local/client.py +14 -10
  22. label_studio_sdk/import_storage/redis/client.py +14 -10
  23. label_studio_sdk/import_storage/s3/client.py +14 -10
  24. label_studio_sdk/import_storage/s3s/client.py +14 -10
  25. label_studio_sdk/label_interface/control_tags.py +2 -1
  26. label_studio_sdk/organizations/__init__.py +1 -2
  27. label_studio_sdk/organizations/client.py +0 -36
  28. label_studio_sdk/organizations/permissions/client.py +32 -0
  29. label_studio_sdk/projects/__init__.py +18 -1
  30. label_studio_sdk/projects/client.py +8 -0
  31. label_studio_sdk/projects/members/client.py +137 -30
  32. label_studio_sdk/projects/metrics/custom/client.py +48 -0
  33. label_studio_sdk/projects/roles/__init__.py +2 -0
  34. label_studio_sdk/projects/roles/client.py +555 -0
  35. label_studio_sdk/projects/stats/__init__.py +16 -0
  36. label_studio_sdk/projects/stats/client.py +626 -0
  37. label_studio_sdk/projects/stats/types/__init__.py +22 -0
  38. label_studio_sdk/projects/stats/types/stats_agreement_annotators_response.py +22 -0
  39. label_studio_sdk/projects/stats/types/stats_users_ground_truth_agreement_response.py +27 -0
  40. label_studio_sdk/projects/stats/types/stats_users_ground_truth_agreement_response_agreement_value.py +5 -0
  41. label_studio_sdk/projects/stats/types/stats_users_prediction_agreement_response.py +27 -0
  42. label_studio_sdk/projects/stats/types/stats_users_prediction_agreement_response_agreement_value.py +5 -0
  43. label_studio_sdk/projects/stats/types/stats_users_review_score_response.py +35 -0
  44. label_studio_sdk/projects/stats/types/stats_users_review_score_response_performance_score_value.py +5 -0
  45. label_studio_sdk/projects/stats/types/stats_users_review_score_response_review_score_value.py +5 -0
  46. label_studio_sdk/prompts/versions/client.py +24 -0
  47. label_studio_sdk/tasks/client.py +10 -0
  48. label_studio_sdk/types/__init__.py +10 -6
  49. label_studio_sdk/types/activity_log.py +1 -0
  50. label_studio_sdk/types/all_roles_project_list.py +6 -2
  51. label_studio_sdk/types/billing_flags.py +1 -1
  52. label_studio_sdk/types/default_role.py +0 -9
  53. label_studio_sdk/types/import_api_request.py +5 -0
  54. label_studio_sdk/types/lse_organization.py +1 -10
  55. label_studio_sdk/types/lse_project.py +6 -6
  56. label_studio_sdk/types/lse_project_counts.py +1 -1
  57. label_studio_sdk/types/lse_project_create.py +5 -1
  58. label_studio_sdk/types/lse_project_response.py +5 -1
  59. label_studio_sdk/types/lse_project_update.py +5 -1
  60. label_studio_sdk/types/lse_task.py +5 -0
  61. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +5 -0
  62. label_studio_sdk/types/project.py +198 -0
  63. label_studio_sdk/types/project_member.py +19 -0
  64. label_studio_sdk/types/project_role.py +35 -0
  65. label_studio_sdk/types/project_sampling.py +7 -0
  66. label_studio_sdk/types/project_skip_queue.py +7 -0
  67. label_studio_sdk/versions/client.py +0 -12
  68. label_studio_sdk/workspaces/__init__.py +2 -2
  69. label_studio_sdk/workspaces/client.py +4 -0
  70. label_studio_sdk/workspaces/projects/__init__.py +2 -0
  71. label_studio_sdk/workspaces/projects/client.py +352 -0
  72. {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/METADATA +1 -1
  73. {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/RECORD +75 -62
  74. label_studio_sdk/organizations/types/__init__.py +0 -5
  75. label_studio_sdk/organizations/types/patched_default_role_request_custom_scripts_editable_by.py +0 -7
  76. label_studio_sdk/types/custom_scripts_editable_by_enum.py +0 -5
  77. label_studio_sdk/types/default_role_custom_scripts_editable_by.py +0 -7
  78. label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +0 -7
  79. {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/LICENSE +0 -0
  80. {label_studio_sdk-2.0.11.dist-info → label_studio_sdk-2.0.13.dist-info}/WHEEL +0 -0
@@ -1,11 +1,11 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ import typing
3
4
  from ...core.client_wrapper import SyncClientWrapper
4
5
  from .bulk.client import BulkClient
5
6
  from .paginated.client import PaginatedClient
6
- import typing
7
7
  from ...core.request_options import RequestOptions
8
- from ...types.lse_user import LseUser
8
+ from ...types.project_member import ProjectMember
9
9
  from ...core.jsonable_encoder import jsonable_encoder
10
10
  from ...core.unchecked_base_model import construct_type
11
11
  from json.decoder import JSONDecodeError
@@ -14,6 +14,9 @@ from ...core.client_wrapper import AsyncClientWrapper
14
14
  from .bulk.client import AsyncBulkClient
15
15
  from .paginated.client import AsyncPaginatedClient
16
16
 
17
+ # this is used as the default value for optional parameters
18
+ OMIT = typing.cast(typing.Any, ...)
19
+
17
20
 
18
21
  class MembersClient:
19
22
  def __init__(self, *, client_wrapper: SyncClientWrapper):
@@ -21,9 +24,7 @@ class MembersClient:
21
24
  self.bulk = BulkClient(client_wrapper=self._client_wrapper)
22
25
  self.paginated = PaginatedClient(client_wrapper=self._client_wrapper)
23
26
 
24
- def get(
25
- self, id: int, *, user_ids: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
26
- ) -> typing.List[LseUser]:
27
+ def add(self, id: int, *, user: int, request_options: typing.Optional[RequestOptions] = None) -> ProjectMember:
27
28
  """
28
29
  <Card href="https://humansignal.com/goenterprise">
29
30
  <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
@@ -31,22 +32,21 @@ class MembersClient:
31
32
  This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
32
33
  </p>
33
34
  </Card>
34
- Retrieve the members for a specific project. Optionally filter by user IDs (comma-separated).
35
+ Add a member to a specific project.
35
36
 
36
37
  Parameters
37
38
  ----------
38
39
  id : int
39
40
 
40
- user_ids : typing.Optional[str]
41
- Comma-separated list of user IDs to include. Example: user_ids=1,2,3
41
+ user : int
42
42
 
43
43
  request_options : typing.Optional[RequestOptions]
44
44
  Request-specific configuration.
45
45
 
46
46
  Returns
47
47
  -------
48
- typing.List[LseUser]
49
- List of users with membership information
48
+ ProjectMember
49
+
50
50
 
51
51
  Examples
52
52
  --------
@@ -55,24 +55,29 @@ class MembersClient:
55
55
  client = LabelStudio(
56
56
  api_key="YOUR_API_KEY",
57
57
  )
58
- client.projects.members.get(
58
+ client.projects.members.add(
59
59
  id=1,
60
+ user=1,
60
61
  )
61
62
  """
62
63
  _response = self._client_wrapper.httpx_client.request(
63
64
  f"api/projects/{jsonable_encoder(id)}/members/",
64
- method="GET",
65
- params={
66
- "user_ids": user_ids,
65
+ method="POST",
66
+ json={
67
+ "user": user,
68
+ },
69
+ headers={
70
+ "content-type": "application/json",
67
71
  },
68
72
  request_options=request_options,
73
+ omit=OMIT,
69
74
  )
70
75
  try:
71
76
  if 200 <= _response.status_code < 300:
72
77
  return typing.cast(
73
- typing.List[LseUser],
78
+ ProjectMember,
74
79
  construct_type(
75
- type_=typing.List[LseUser], # type: ignore
80
+ type_=ProjectMember, # type: ignore
76
81
  object_=_response.json(),
77
82
  ),
78
83
  )
@@ -81,6 +86,51 @@ class MembersClient:
81
86
  raise ApiError(status_code=_response.status_code, body=_response.text)
82
87
  raise ApiError(status_code=_response.status_code, body=_response_json)
83
88
 
89
+ def remove(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
90
+ """
91
+ <Card href="https://humansignal.com/goenterprise">
92
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
93
+ <p style="margin-top: 10px; font-size: 14px;">
94
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
95
+ </p>
96
+ </Card>
97
+ Remove a member from a specific project.
98
+
99
+ Parameters
100
+ ----------
101
+ id : int
102
+
103
+ request_options : typing.Optional[RequestOptions]
104
+ Request-specific configuration.
105
+
106
+ Returns
107
+ -------
108
+ None
109
+
110
+ Examples
111
+ --------
112
+ from label_studio_sdk import LabelStudio
113
+
114
+ client = LabelStudio(
115
+ api_key="YOUR_API_KEY",
116
+ )
117
+ client.projects.members.remove(
118
+ id=1,
119
+ )
120
+ """
121
+ _response = self._client_wrapper.httpx_client.request(
122
+ f"api/projects/{jsonable_encoder(id)}/members/",
123
+ method="DELETE",
124
+ request_options=request_options,
125
+ )
126
+ try:
127
+ if 200 <= _response.status_code < 300:
128
+ return
129
+ _response_json = _response.json()
130
+ except JSONDecodeError:
131
+ raise ApiError(status_code=_response.status_code, body=_response.text)
132
+ raise ApiError(status_code=_response.status_code, body=_response_json)
133
+
84
134
 
85
135
  class AsyncMembersClient:
86
136
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -88,9 +138,9 @@ class AsyncMembersClient:
88
138
  self.bulk = AsyncBulkClient(client_wrapper=self._client_wrapper)
89
139
  self.paginated = AsyncPaginatedClient(client_wrapper=self._client_wrapper)
90
140
 
91
- async def get(
92
- self, id: int, *, user_ids: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
93
- ) -> typing.List[LseUser]:
141
+ async def add(
142
+ self, id: int, *, user: int, request_options: typing.Optional[RequestOptions] = None
143
+ ) -> ProjectMember:
94
144
  """
95
145
  <Card href="https://humansignal.com/goenterprise">
96
146
  <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
@@ -98,22 +148,21 @@ class AsyncMembersClient:
98
148
  This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
99
149
  </p>
100
150
  </Card>
101
- Retrieve the members for a specific project. Optionally filter by user IDs (comma-separated).
151
+ Add a member to a specific project.
102
152
 
103
153
  Parameters
104
154
  ----------
105
155
  id : int
106
156
 
107
- user_ids : typing.Optional[str]
108
- Comma-separated list of user IDs to include. Example: user_ids=1,2,3
157
+ user : int
109
158
 
110
159
  request_options : typing.Optional[RequestOptions]
111
160
  Request-specific configuration.
112
161
 
113
162
  Returns
114
163
  -------
115
- typing.List[LseUser]
116
- List of users with membership information
164
+ ProjectMember
165
+
117
166
 
118
167
  Examples
119
168
  --------
@@ -127,8 +176,9 @@ class AsyncMembersClient:
127
176
 
128
177
 
129
178
  async def main() -> None:
130
- await client.projects.members.get(
179
+ await client.projects.members.add(
131
180
  id=1,
181
+ user=1,
132
182
  )
133
183
 
134
184
 
@@ -136,18 +186,22 @@ class AsyncMembersClient:
136
186
  """
137
187
  _response = await self._client_wrapper.httpx_client.request(
138
188
  f"api/projects/{jsonable_encoder(id)}/members/",
139
- method="GET",
140
- params={
141
- "user_ids": user_ids,
189
+ method="POST",
190
+ json={
191
+ "user": user,
192
+ },
193
+ headers={
194
+ "content-type": "application/json",
142
195
  },
143
196
  request_options=request_options,
197
+ omit=OMIT,
144
198
  )
145
199
  try:
146
200
  if 200 <= _response.status_code < 300:
147
201
  return typing.cast(
148
- typing.List[LseUser],
202
+ ProjectMember,
149
203
  construct_type(
150
- type_=typing.List[LseUser], # type: ignore
204
+ type_=ProjectMember, # type: ignore
151
205
  object_=_response.json(),
152
206
  ),
153
207
  )
@@ -155,3 +209,56 @@ class AsyncMembersClient:
155
209
  except JSONDecodeError:
156
210
  raise ApiError(status_code=_response.status_code, body=_response.text)
157
211
  raise ApiError(status_code=_response.status_code, body=_response_json)
212
+
213
+ async def remove(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
214
+ """
215
+ <Card href="https://humansignal.com/goenterprise">
216
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
217
+ <p style="margin-top: 10px; font-size: 14px;">
218
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
219
+ </p>
220
+ </Card>
221
+ Remove a member from a specific project.
222
+
223
+ Parameters
224
+ ----------
225
+ id : int
226
+
227
+ request_options : typing.Optional[RequestOptions]
228
+ Request-specific configuration.
229
+
230
+ Returns
231
+ -------
232
+ None
233
+
234
+ Examples
235
+ --------
236
+ import asyncio
237
+
238
+ from label_studio_sdk import AsyncLabelStudio
239
+
240
+ client = AsyncLabelStudio(
241
+ api_key="YOUR_API_KEY",
242
+ )
243
+
244
+
245
+ async def main() -> None:
246
+ await client.projects.members.remove(
247
+ id=1,
248
+ )
249
+
250
+
251
+ asyncio.run(main())
252
+ """
253
+ _response = await self._client_wrapper.httpx_client.request(
254
+ f"api/projects/{jsonable_encoder(id)}/members/",
255
+ method="DELETE",
256
+ request_options=request_options,
257
+ )
258
+ try:
259
+ if 200 <= _response.status_code < 300:
260
+ return
261
+ _response_json = _response.json()
262
+ except JSONDecodeError:
263
+ raise ApiError(status_code=_response.status_code, body=_response.text)
264
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -23,6 +23,12 @@ class CustomClient:
23
23
  self, id: int, *, request_options: typing.Optional[RequestOptions] = None
24
24
  ) -> CustomGetLambdaResponse:
25
25
  """
26
+ <Card href="https://humansignal.com/goenterprise">
27
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
28
+ <p style="margin-top: 10px; font-size: 14px;">
29
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
30
+ </p>
31
+ </Card>
26
32
  Get the AWS Lambda code for the custom metric configured for this project.
27
33
 
28
34
  Parameters
@@ -77,6 +83,12 @@ class CustomClient:
77
83
  request_options: typing.Optional[RequestOptions] = None,
78
84
  ) -> None:
79
85
  """
86
+ <Card href="https://humansignal.com/goenterprise">
87
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
88
+ <p style="margin-top: 10px; font-size: 14px;">
89
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
90
+ </p>
91
+ </Card>
80
92
  Create or update the AWS Lambda function used for custom metrics in this project.
81
93
 
82
94
  Parameters
@@ -150,6 +162,12 @@ class CustomClient:
150
162
  request_options: typing.Optional[RequestOptions] = None,
151
163
  ) -> typing.Dict[str, typing.Optional[typing.Any]]:
152
164
  """
165
+ <Card href="https://humansignal.com/goenterprise">
166
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
167
+ <p style="margin-top: 10px; font-size: 14px;">
168
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
169
+ </p>
170
+ </Card>
153
171
  Get AWS lambda logs for project, including filtering by start and end dates
154
172
 
155
173
  Parameters
@@ -210,6 +228,12 @@ class CustomClient:
210
228
 
211
229
  def check_function(self, id: int, *, code: str, request_options: typing.Optional[RequestOptions] = None) -> None:
212
230
  """
231
+ <Card href="https://humansignal.com/goenterprise">
232
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
233
+ <p style="margin-top: 10px; font-size: 14px;">
234
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
235
+ </p>
236
+ </Card>
213
237
  Validate custom matching function code for the project.
214
238
 
215
239
  Parameters
@@ -266,6 +290,12 @@ class AsyncCustomClient:
266
290
  self, id: int, *, request_options: typing.Optional[RequestOptions] = None
267
291
  ) -> CustomGetLambdaResponse:
268
292
  """
293
+ <Card href="https://humansignal.com/goenterprise">
294
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
295
+ <p style="margin-top: 10px; font-size: 14px;">
296
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
297
+ </p>
298
+ </Card>
269
299
  Get the AWS Lambda code for the custom metric configured for this project.
270
300
 
271
301
  Parameters
@@ -328,6 +358,12 @@ class AsyncCustomClient:
328
358
  request_options: typing.Optional[RequestOptions] = None,
329
359
  ) -> None:
330
360
  """
361
+ <Card href="https://humansignal.com/goenterprise">
362
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
363
+ <p style="margin-top: 10px; font-size: 14px;">
364
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
365
+ </p>
366
+ </Card>
331
367
  Create or update the AWS Lambda function used for custom metrics in this project.
332
368
 
333
369
  Parameters
@@ -409,6 +445,12 @@ class AsyncCustomClient:
409
445
  request_options: typing.Optional[RequestOptions] = None,
410
446
  ) -> typing.Dict[str, typing.Optional[typing.Any]]:
411
447
  """
448
+ <Card href="https://humansignal.com/goenterprise">
449
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
450
+ <p style="margin-top: 10px; font-size: 14px;">
451
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
452
+ </p>
453
+ </Card>
412
454
  Get AWS lambda logs for project, including filtering by start and end dates
413
455
 
414
456
  Parameters
@@ -479,6 +521,12 @@ class AsyncCustomClient:
479
521
  self, id: int, *, code: str, request_options: typing.Optional[RequestOptions] = None
480
522
  ) -> None:
481
523
  """
524
+ <Card href="https://humansignal.com/goenterprise">
525
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
526
+ <p style="margin-top: 10px; font-size: 14px;">
527
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
528
+ </p>
529
+ </Card>
482
530
  Validate custom matching function code for the project.
483
531
 
484
532
  Parameters
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+