label-studio-sdk 2.0.5__py3-none-any.whl → 2.0.7__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 (92) hide show
  1. label_studio_sdk/__init__.py +70 -0
  2. label_studio_sdk/annotation_history/__init__.py +5 -0
  3. label_studio_sdk/annotation_history/client.py +415 -0
  4. label_studio_sdk/annotation_history/types/__init__.py +5 -0
  5. label_studio_sdk/annotation_history/types/annotation_history_delete_response.py +22 -0
  6. label_studio_sdk/annotation_reviews/__init__.py +2 -0
  7. label_studio_sdk/annotation_reviews/client.py +713 -0
  8. label_studio_sdk/base_client.py +20 -0
  9. label_studio_sdk/blueprints/__init__.py +2 -0
  10. label_studio_sdk/blueprints/client.py +272 -0
  11. label_studio_sdk/core/client_wrapper.py +2 -1
  12. label_studio_sdk/export_storage/__init__.py +2 -2
  13. label_studio_sdk/export_storage/azure_spi/__init__.py +2 -0
  14. label_studio_sdk/export_storage/azure_spi/client.py +1354 -0
  15. label_studio_sdk/export_storage/client.py +8 -0
  16. label_studio_sdk/export_storage/gcswif/__init__.py +2 -0
  17. label_studio_sdk/export_storage/gcswif/client.py +1376 -0
  18. label_studio_sdk/import_storage/__init__.py +2 -2
  19. label_studio_sdk/import_storage/azure_spi/__init__.py +2 -0
  20. label_studio_sdk/import_storage/azure_spi/client.py +1378 -0
  21. label_studio_sdk/import_storage/client.py +8 -0
  22. label_studio_sdk/import_storage/gcswif/__init__.py +2 -0
  23. label_studio_sdk/import_storage/gcswif/client.py +1400 -0
  24. label_studio_sdk/jwt_settings/client.py +10 -8
  25. label_studio_sdk/label_interface/control_tags.py +38 -0
  26. label_studio_sdk/label_interface/data_examples.json +10 -0
  27. label_studio_sdk/label_interface/interface.py +13 -0
  28. label_studio_sdk/label_interface/object_tags.py +9 -0
  29. label_studio_sdk/ml/client.py +124 -0
  30. label_studio_sdk/organizations/__init__.py +3 -2
  31. label_studio_sdk/organizations/client.py +536 -1
  32. label_studio_sdk/organizations/invites/__init__.py +2 -0
  33. label_studio_sdk/organizations/invites/client.py +368 -0
  34. label_studio_sdk/organizations/types/__init__.py +5 -0
  35. label_studio_sdk/organizations/types/patched_default_role_request_custom_scripts_editable_by.py +7 -0
  36. label_studio_sdk/project_templates/__init__.py +2 -0
  37. label_studio_sdk/project_templates/client.py +909 -0
  38. label_studio_sdk/projects/client.py +8 -0
  39. label_studio_sdk/projects/members/__init__.py +2 -2
  40. label_studio_sdk/projects/members/bulk/client.py +46 -2
  41. label_studio_sdk/projects/members/client.py +4 -0
  42. label_studio_sdk/projects/members/paginated/__init__.py +2 -0
  43. label_studio_sdk/projects/members/paginated/client.py +248 -0
  44. label_studio_sdk/session_policy/__init__.py +2 -0
  45. label_studio_sdk/session_policy/client.py +247 -0
  46. label_studio_sdk/tasks/client.py +371 -0
  47. label_studio_sdk/types/__init__.py +56 -0
  48. label_studio_sdk/types/action_enum.py +19 -0
  49. label_studio_sdk/types/all_roles_project_list.py +1 -1
  50. label_studio_sdk/types/annotation.py +7 -0
  51. label_studio_sdk/types/annotation_history.py +81 -0
  52. label_studio_sdk/types/annotation_history_action.py +7 -0
  53. label_studio_sdk/types/annotation_request.py +7 -0
  54. label_studio_sdk/types/annotation_review.py +61 -0
  55. label_studio_sdk/types/annotation_review_request.py +41 -0
  56. label_studio_sdk/types/azure_service_principal_export_storage.py +114 -0
  57. label_studio_sdk/types/azure_service_principal_export_storage_request.py +107 -0
  58. label_studio_sdk/types/azure_service_principal_import_storage.py +115 -0
  59. label_studio_sdk/types/azure_service_principal_import_storage_request.py +108 -0
  60. label_studio_sdk/types/blueprint.py +41 -0
  61. label_studio_sdk/types/default_role.py +75 -0
  62. label_studio_sdk/types/default_role_custom_scripts_editable_by.py +7 -0
  63. label_studio_sdk/types/gcswif_export_storage.py +119 -0
  64. label_studio_sdk/types/gcswif_export_storage_request.py +112 -0
  65. label_studio_sdk/types/gcswif_import_storage.py +120 -0
  66. label_studio_sdk/types/gcswif_import_storage_request.py +113 -0
  67. label_studio_sdk/types/lse_project.py +223 -0
  68. label_studio_sdk/types/lse_project_sampling.py +7 -0
  69. label_studio_sdk/types/lse_project_skip_queue.py +7 -0
  70. label_studio_sdk/types/lse_project_update.py +1 -0
  71. label_studio_sdk/types/lse_task.py +1 -0
  72. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +1 -0
  73. label_studio_sdk/types/lsejwt_settings.py +1 -5
  74. label_studio_sdk/types/paginated_annotation_history_list.py +23 -0
  75. label_studio_sdk/types/paginated_lse_user_list.py +23 -0
  76. label_studio_sdk/types/paginated_paginated_project_member_list.py +23 -0
  77. label_studio_sdk/types/paginated_project_member.py +50 -0
  78. label_studio_sdk/types/project_member_bulk_assign_roles_request.py +21 -0
  79. label_studio_sdk/types/project_template.py +41 -0
  80. label_studio_sdk/types/project_template_request.py +38 -0
  81. label_studio_sdk/types/review_settings.py +5 -0
  82. label_studio_sdk/types/review_settings_request.py +5 -0
  83. label_studio_sdk/types/session_timeout_policy.py +31 -0
  84. label_studio_sdk/types/task_event.py +61 -0
  85. label_studio_sdk/workspaces/members/__init__.py +2 -2
  86. label_studio_sdk/workspaces/members/client.py +4 -0
  87. label_studio_sdk/workspaces/members/paginated/__init__.py +2 -0
  88. label_studio_sdk/workspaces/members/paginated/client.py +212 -0
  89. {label_studio_sdk-2.0.5.dist-info → label_studio_sdk-2.0.7.dist-info}/METADATA +2 -2
  90. {label_studio_sdk-2.0.5.dist-info → label_studio_sdk-2.0.7.dist-info}/RECORD +92 -36
  91. {label_studio_sdk-2.0.5.dist-info → label_studio_sdk-2.0.7.dist-info}/LICENSE +0 -0
  92. {label_studio_sdk-2.0.5.dist-info → label_studio_sdk-2.0.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,368 @@
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.organization_invite import OrganizationInvite
7
+ from ...core.unchecked_base_model import construct_type
8
+ from ...errors.forbidden_error import ForbiddenError
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 InvitesClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._client_wrapper = client_wrapper
20
+
21
+ def get_invite_link(self, *, request_options: typing.Optional[RequestOptions] = None) -> OrganizationInvite:
22
+ """
23
+ Get invite link for organization
24
+
25
+ Parameters
26
+ ----------
27
+ request_options : typing.Optional[RequestOptions]
28
+ Request-specific configuration.
29
+
30
+ Returns
31
+ -------
32
+ OrganizationInvite
33
+
34
+
35
+ Examples
36
+ --------
37
+ from label_studio_sdk import LabelStudio
38
+
39
+ client = LabelStudio(
40
+ api_key="YOUR_API_KEY",
41
+ )
42
+ client.organizations.invites.get_invite_link()
43
+ """
44
+ _response = self._client_wrapper.httpx_client.request(
45
+ "api/invite",
46
+ method="GET",
47
+ request_options=request_options,
48
+ )
49
+ try:
50
+ if 200 <= _response.status_code < 300:
51
+ return typing.cast(
52
+ OrganizationInvite,
53
+ construct_type(
54
+ type_=OrganizationInvite, # type: ignore
55
+ object_=_response.json(),
56
+ ),
57
+ )
58
+ if _response.status_code == 403:
59
+ raise ForbiddenError(
60
+ typing.cast(
61
+ typing.Optional[typing.Any],
62
+ construct_type(
63
+ type_=typing.Optional[typing.Any], # type: ignore
64
+ object_=_response.json(),
65
+ ),
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 revoke_invite(self, *, email: str, request_options: typing.Optional[RequestOptions] = None) -> None:
74
+ """
75
+ Revoke invite to organization
76
+
77
+ Parameters
78
+ ----------
79
+ email : str
80
+
81
+ request_options : typing.Optional[RequestOptions]
82
+ Request-specific configuration.
83
+
84
+ Returns
85
+ -------
86
+ None
87
+
88
+ Examples
89
+ --------
90
+ from label_studio_sdk import LabelStudio
91
+
92
+ client = LabelStudio(
93
+ api_key="YOUR_API_KEY",
94
+ )
95
+ client.organizations.invites.revoke_invite(
96
+ email="email",
97
+ )
98
+ """
99
+ _response = self._client_wrapper.httpx_client.request(
100
+ "api/invite/revoke",
101
+ method="POST",
102
+ json={
103
+ "email": email,
104
+ },
105
+ headers={
106
+ "content-type": "application/json",
107
+ },
108
+ request_options=request_options,
109
+ omit=OMIT,
110
+ )
111
+ try:
112
+ if 200 <= _response.status_code < 300:
113
+ return
114
+ _response_json = _response.json()
115
+ except JSONDecodeError:
116
+ raise ApiError(status_code=_response.status_code, body=_response.text)
117
+ raise ApiError(status_code=_response.status_code, body=_response_json)
118
+
119
+ def send_email(
120
+ self, *, emails: typing.Sequence[str], role: str, request_options: typing.Optional[RequestOptions] = None
121
+ ) -> None:
122
+ """
123
+ Send email with invite to organization
124
+
125
+ Parameters
126
+ ----------
127
+ emails : typing.Sequence[str]
128
+
129
+ role : str
130
+
131
+ request_options : typing.Optional[RequestOptions]
132
+ Request-specific configuration.
133
+
134
+ Returns
135
+ -------
136
+ None
137
+
138
+ Examples
139
+ --------
140
+ from label_studio_sdk import LabelStudio
141
+
142
+ client = LabelStudio(
143
+ api_key="YOUR_API_KEY",
144
+ )
145
+ client.organizations.invites.send_email(
146
+ emails=["emails"],
147
+ role="role",
148
+ )
149
+ """
150
+ _response = self._client_wrapper.httpx_client.request(
151
+ "api/invite/send-email",
152
+ method="POST",
153
+ json={
154
+ "emails": emails,
155
+ "role": role,
156
+ },
157
+ headers={
158
+ "content-type": "application/json",
159
+ },
160
+ request_options=request_options,
161
+ omit=OMIT,
162
+ )
163
+ try:
164
+ if 200 <= _response.status_code < 300:
165
+ return
166
+ if _response.status_code == 403:
167
+ raise ForbiddenError(
168
+ typing.cast(
169
+ typing.Optional[typing.Any],
170
+ construct_type(
171
+ type_=typing.Optional[typing.Any], # type: ignore
172
+ object_=_response.json(),
173
+ ),
174
+ )
175
+ )
176
+ _response_json = _response.json()
177
+ except JSONDecodeError:
178
+ raise ApiError(status_code=_response.status_code, body=_response.text)
179
+ raise ApiError(status_code=_response.status_code, body=_response_json)
180
+
181
+
182
+ class AsyncInvitesClient:
183
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
184
+ self._client_wrapper = client_wrapper
185
+
186
+ async def get_invite_link(self, *, request_options: typing.Optional[RequestOptions] = None) -> OrganizationInvite:
187
+ """
188
+ Get invite link for organization
189
+
190
+ Parameters
191
+ ----------
192
+ request_options : typing.Optional[RequestOptions]
193
+ Request-specific configuration.
194
+
195
+ Returns
196
+ -------
197
+ OrganizationInvite
198
+
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.organizations.invites.get_invite_link()
213
+
214
+
215
+ asyncio.run(main())
216
+ """
217
+ _response = await self._client_wrapper.httpx_client.request(
218
+ "api/invite",
219
+ method="GET",
220
+ request_options=request_options,
221
+ )
222
+ try:
223
+ if 200 <= _response.status_code < 300:
224
+ return typing.cast(
225
+ OrganizationInvite,
226
+ construct_type(
227
+ type_=OrganizationInvite, # type: ignore
228
+ object_=_response.json(),
229
+ ),
230
+ )
231
+ if _response.status_code == 403:
232
+ raise ForbiddenError(
233
+ typing.cast(
234
+ typing.Optional[typing.Any],
235
+ construct_type(
236
+ type_=typing.Optional[typing.Any], # type: ignore
237
+ object_=_response.json(),
238
+ ),
239
+ )
240
+ )
241
+ _response_json = _response.json()
242
+ except JSONDecodeError:
243
+ raise ApiError(status_code=_response.status_code, body=_response.text)
244
+ raise ApiError(status_code=_response.status_code, body=_response_json)
245
+
246
+ async def revoke_invite(self, *, email: str, request_options: typing.Optional[RequestOptions] = None) -> None:
247
+ """
248
+ Revoke invite to organization
249
+
250
+ Parameters
251
+ ----------
252
+ email : str
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.organizations.invites.revoke_invite(
274
+ email="email",
275
+ )
276
+
277
+
278
+ asyncio.run(main())
279
+ """
280
+ _response = await self._client_wrapper.httpx_client.request(
281
+ "api/invite/revoke",
282
+ method="POST",
283
+ json={
284
+ "email": email,
285
+ },
286
+ headers={
287
+ "content-type": "application/json",
288
+ },
289
+ request_options=request_options,
290
+ omit=OMIT,
291
+ )
292
+ try:
293
+ if 200 <= _response.status_code < 300:
294
+ return
295
+ _response_json = _response.json()
296
+ except JSONDecodeError:
297
+ raise ApiError(status_code=_response.status_code, body=_response.text)
298
+ raise ApiError(status_code=_response.status_code, body=_response_json)
299
+
300
+ async def send_email(
301
+ self, *, emails: typing.Sequence[str], role: str, request_options: typing.Optional[RequestOptions] = None
302
+ ) -> None:
303
+ """
304
+ Send email with invite to organization
305
+
306
+ Parameters
307
+ ----------
308
+ emails : typing.Sequence[str]
309
+
310
+ role : str
311
+
312
+ request_options : typing.Optional[RequestOptions]
313
+ Request-specific configuration.
314
+
315
+ Returns
316
+ -------
317
+ None
318
+
319
+ Examples
320
+ --------
321
+ import asyncio
322
+
323
+ from label_studio_sdk import AsyncLabelStudio
324
+
325
+ client = AsyncLabelStudio(
326
+ api_key="YOUR_API_KEY",
327
+ )
328
+
329
+
330
+ async def main() -> None:
331
+ await client.organizations.invites.send_email(
332
+ emails=["emails"],
333
+ role="role",
334
+ )
335
+
336
+
337
+ asyncio.run(main())
338
+ """
339
+ _response = await self._client_wrapper.httpx_client.request(
340
+ "api/invite/send-email",
341
+ method="POST",
342
+ json={
343
+ "emails": emails,
344
+ "role": role,
345
+ },
346
+ headers={
347
+ "content-type": "application/json",
348
+ },
349
+ request_options=request_options,
350
+ omit=OMIT,
351
+ )
352
+ try:
353
+ if 200 <= _response.status_code < 300:
354
+ return
355
+ if _response.status_code == 403:
356
+ raise ForbiddenError(
357
+ typing.cast(
358
+ typing.Optional[typing.Any],
359
+ construct_type(
360
+ type_=typing.Optional[typing.Any], # type: ignore
361
+ object_=_response.json(),
362
+ ),
363
+ )
364
+ )
365
+ _response_json = _response.json()
366
+ except JSONDecodeError:
367
+ raise ApiError(status_code=_response.status_code, body=_response.text)
368
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .patched_default_role_request_custom_scripts_editable_by import PatchedDefaultRoleRequestCustomScriptsEditableBy
4
+
5
+ __all__ = ["PatchedDefaultRoleRequestCustomScriptsEditableBy"]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ...types.custom_scripts_editable_by_enum import CustomScriptsEditableByEnum
5
+ from ...types.null_enum import NullEnum
6
+
7
+ PatchedDefaultRoleRequestCustomScriptsEditableBy = typing.Union[CustomScriptsEditableByEnum, NullEnum]
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+