label-studio-sdk 2.0.8__py3-none-any.whl → 2.0.9__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 (70) hide show
  1. label_studio_sdk/__init__.py +36 -16
  2. label_studio_sdk/base_client.py +0 -4
  3. label_studio_sdk/core/client_wrapper.py +1 -1
  4. label_studio_sdk/export_storage/__init__.py +13 -2
  5. label_studio_sdk/export_storage/client.py +4 -0
  6. label_studio_sdk/export_storage/databricks/client.py +1406 -0
  7. label_studio_sdk/import_storage/__init__.py +13 -2
  8. label_studio_sdk/import_storage/client.py +4 -0
  9. label_studio_sdk/import_storage/databricks/__init__.py +2 -0
  10. label_studio_sdk/import_storage/databricks/client.py +1466 -0
  11. label_studio_sdk/import_storage/gcswif/client.py +30 -0
  12. label_studio_sdk/projects/__init__.py +0 -2
  13. label_studio_sdk/projects/client.py +186 -32
  14. label_studio_sdk/projects/client_ext.py +20 -8
  15. label_studio_sdk/projects/types/__init__.py +0 -2
  16. label_studio_sdk/projects/types/lse_project_create_request_sampling.py +2 -2
  17. label_studio_sdk/projects/types/patched_lse_project_update_request_sampling.py +2 -2
  18. label_studio_sdk/prompts/client.py +340 -1
  19. label_studio_sdk/prompts/runs/client.py +127 -0
  20. label_studio_sdk/tasks/client.py +7 -2
  21. label_studio_sdk/types/__init__.py +36 -12
  22. label_studio_sdk/types/all_roles_project_list.py +10 -10
  23. label_studio_sdk/types/all_roles_project_list_sampling.py +2 -2
  24. label_studio_sdk/types/azure_blob_import_storage.py +5 -0
  25. label_studio_sdk/types/cancel_model_run_response.py +19 -0
  26. label_studio_sdk/types/configurable_permission_option.py +2 -2
  27. label_studio_sdk/types/databricks_export_storage.py +113 -0
  28. label_studio_sdk/types/databricks_export_storage_request.py +107 -0
  29. label_studio_sdk/types/databricks_import_storage.py +123 -0
  30. label_studio_sdk/types/databricks_import_storage_request.py +117 -0
  31. label_studio_sdk/types/default165enum.py +5 -0
  32. label_studio_sdk/types/gcs_import_storage.py +5 -0
  33. label_studio_sdk/types/gcswif_import_storage.py +5 -0
  34. label_studio_sdk/types/gcswif_import_storage_request.py +5 -0
  35. label_studio_sdk/types/local_files_import_storage.py +5 -0
  36. label_studio_sdk/types/lse_project_counts.py +8 -8
  37. label_studio_sdk/types/lse_project_create_sampling.py +2 -2
  38. label_studio_sdk/types/{project.py → lse_project_response.py} +44 -31
  39. label_studio_sdk/types/lse_project_response_sampling.py +7 -0
  40. label_studio_sdk/types/{project_skip_queue.py → lse_project_response_skip_queue.py} +1 -1
  41. label_studio_sdk/types/lse_project_sampling.py +2 -2
  42. label_studio_sdk/types/lse_project_update_sampling.py +2 -2
  43. label_studio_sdk/types/lse_task.py +6 -0
  44. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +6 -0
  45. label_studio_sdk/types/lse_user.py +1 -0
  46. label_studio_sdk/types/lse_user_api.py +1 -0
  47. label_studio_sdk/types/options165enum.py +5 -0
  48. label_studio_sdk/types/organization_permission.py +7 -4
  49. label_studio_sdk/types/paginated_project_member.py +1 -0
  50. label_studio_sdk/types/paginated_project_subset_tasks_response_list.py +23 -0
  51. label_studio_sdk/types/project_subset_item.py +21 -0
  52. label_studio_sdk/types/project_subset_task_item.py +24 -0
  53. label_studio_sdk/types/project_subset_tasks_response.py +27 -0
  54. label_studio_sdk/types/review_settings.py +14 -0
  55. label_studio_sdk/types/review_settings_request.py +14 -0
  56. label_studio_sdk/types/review_settings_request_sampling.py +8 -0
  57. label_studio_sdk/types/review_settings_sampling.py +8 -0
  58. label_studio_sdk/types/review_settings_sampling_enum.py +5 -0
  59. label_studio_sdk/types/{sampling_enum.py → sampling_de5enum.py} +1 -1
  60. label_studio_sdk/types/who_am_i_user.py +1 -0
  61. {label_studio_sdk-2.0.8.dist-info → label_studio_sdk-2.0.9.dist-info}/METADATA +41 -90
  62. {label_studio_sdk-2.0.8.dist-info → label_studio_sdk-2.0.9.dist-info}/RECORD +65 -52
  63. label_studio_sdk/blueprints/client.py +0 -272
  64. label_studio_sdk/projects/types/projects_list_request_filter.py +0 -5
  65. label_studio_sdk/types/blueprint.py +0 -41
  66. label_studio_sdk/types/configurable_permission_option_default.py +0 -7
  67. label_studio_sdk/types/project_sampling.py +0 -7
  68. /label_studio_sdk/{blueprints → export_storage/databricks}/__init__.py +0 -0
  69. {label_studio_sdk-2.0.8.dist-info → label_studio_sdk-2.0.9.dist-info}/LICENSE +0 -0
  70. {label_studio_sdk-2.0.8.dist-info → label_studio_sdk-2.0.9.dist-info}/WHEEL +0 -0
@@ -1,272 +0,0 @@
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.blueprint import Blueprint
7
- from ..core.unchecked_base_model import construct_type
8
- from json.decoder import JSONDecodeError
9
- from ..core.api_error import ApiError
10
- from ..core.jsonable_encoder import jsonable_encoder
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 BlueprintsClient:
18
- def __init__(self, *, client_wrapper: SyncClientWrapper):
19
- self._client_wrapper = client_wrapper
20
-
21
- def create(
22
- self,
23
- *,
24
- project: int,
25
- created_by: typing.Optional[int] = OMIT,
26
- description: typing.Optional[str] = OMIT,
27
- label_config: typing.Optional[str] = OMIT,
28
- title: typing.Optional[str] = OMIT,
29
- request_options: typing.Optional[RequestOptions] = None,
30
- ) -> Blueprint:
31
- """
32
- Create a new blueprint
33
-
34
- Parameters
35
- ----------
36
- project : int
37
-
38
- created_by : typing.Optional[int]
39
-
40
- description : typing.Optional[str]
41
- Project description
42
-
43
- label_config : typing.Optional[str]
44
- Labeling configuration in XML format
45
-
46
- title : typing.Optional[str]
47
- Blueprint name. Must be between 3 and 50 characters long.
48
-
49
- request_options : typing.Optional[RequestOptions]
50
- Request-specific configuration.
51
-
52
- Returns
53
- -------
54
- Blueprint
55
-
56
-
57
- Examples
58
- --------
59
- from label_studio_sdk import LabelStudio
60
-
61
- client = LabelStudio(
62
- api_key="YOUR_API_KEY",
63
- )
64
- client.blueprints.create(
65
- project=1,
66
- )
67
- """
68
- _response = self._client_wrapper.httpx_client.request(
69
- "api/blueprints/",
70
- method="POST",
71
- json={
72
- "created_by": created_by,
73
- "description": description,
74
- "label_config": label_config,
75
- "project": project,
76
- "title": title,
77
- },
78
- headers={
79
- "content-type": "application/json",
80
- },
81
- request_options=request_options,
82
- omit=OMIT,
83
- )
84
- try:
85
- if 200 <= _response.status_code < 300:
86
- return typing.cast(
87
- Blueprint,
88
- construct_type(
89
- type_=Blueprint, # type: ignore
90
- object_=_response.json(),
91
- ),
92
- )
93
- _response_json = _response.json()
94
- except JSONDecodeError:
95
- raise ApiError(status_code=_response.status_code, body=_response.text)
96
- raise ApiError(status_code=_response.status_code, body=_response_json)
97
-
98
- def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
99
- """
100
- Delete a blueprint by ID
101
-
102
- Parameters
103
- ----------
104
- id : str
105
-
106
- request_options : typing.Optional[RequestOptions]
107
- Request-specific configuration.
108
-
109
- Returns
110
- -------
111
- None
112
-
113
- Examples
114
- --------
115
- from label_studio_sdk import LabelStudio
116
-
117
- client = LabelStudio(
118
- api_key="YOUR_API_KEY",
119
- )
120
- client.blueprints.delete(
121
- id="id",
122
- )
123
- """
124
- _response = self._client_wrapper.httpx_client.request(
125
- f"api/blueprints/{jsonable_encoder(id)}/",
126
- method="DELETE",
127
- request_options=request_options,
128
- )
129
- try:
130
- if 200 <= _response.status_code < 300:
131
- return
132
- _response_json = _response.json()
133
- except JSONDecodeError:
134
- raise ApiError(status_code=_response.status_code, body=_response.text)
135
- raise ApiError(status_code=_response.status_code, body=_response_json)
136
-
137
-
138
- class AsyncBlueprintsClient:
139
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
140
- self._client_wrapper = client_wrapper
141
-
142
- async def create(
143
- self,
144
- *,
145
- project: int,
146
- created_by: typing.Optional[int] = OMIT,
147
- description: typing.Optional[str] = OMIT,
148
- label_config: typing.Optional[str] = OMIT,
149
- title: typing.Optional[str] = OMIT,
150
- request_options: typing.Optional[RequestOptions] = None,
151
- ) -> Blueprint:
152
- """
153
- Create a new blueprint
154
-
155
- Parameters
156
- ----------
157
- project : int
158
-
159
- created_by : typing.Optional[int]
160
-
161
- description : typing.Optional[str]
162
- Project description
163
-
164
- label_config : typing.Optional[str]
165
- Labeling configuration in XML format
166
-
167
- title : typing.Optional[str]
168
- Blueprint name. Must be between 3 and 50 characters long.
169
-
170
- request_options : typing.Optional[RequestOptions]
171
- Request-specific configuration.
172
-
173
- Returns
174
- -------
175
- Blueprint
176
-
177
-
178
- Examples
179
- --------
180
- import asyncio
181
-
182
- from label_studio_sdk import AsyncLabelStudio
183
-
184
- client = AsyncLabelStudio(
185
- api_key="YOUR_API_KEY",
186
- )
187
-
188
-
189
- async def main() -> None:
190
- await client.blueprints.create(
191
- project=1,
192
- )
193
-
194
-
195
- asyncio.run(main())
196
- """
197
- _response = await self._client_wrapper.httpx_client.request(
198
- "api/blueprints/",
199
- method="POST",
200
- json={
201
- "created_by": created_by,
202
- "description": description,
203
- "label_config": label_config,
204
- "project": project,
205
- "title": title,
206
- },
207
- headers={
208
- "content-type": "application/json",
209
- },
210
- request_options=request_options,
211
- omit=OMIT,
212
- )
213
- try:
214
- if 200 <= _response.status_code < 300:
215
- return typing.cast(
216
- Blueprint,
217
- construct_type(
218
- type_=Blueprint, # type: ignore
219
- object_=_response.json(),
220
- ),
221
- )
222
- _response_json = _response.json()
223
- except JSONDecodeError:
224
- raise ApiError(status_code=_response.status_code, body=_response.text)
225
- raise ApiError(status_code=_response.status_code, body=_response_json)
226
-
227
- async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
228
- """
229
- Delete a blueprint by ID
230
-
231
- Parameters
232
- ----------
233
- id : str
234
-
235
- request_options : typing.Optional[RequestOptions]
236
- Request-specific configuration.
237
-
238
- Returns
239
- -------
240
- None
241
-
242
- Examples
243
- --------
244
- import asyncio
245
-
246
- from label_studio_sdk import AsyncLabelStudio
247
-
248
- client = AsyncLabelStudio(
249
- api_key="YOUR_API_KEY",
250
- )
251
-
252
-
253
- async def main() -> None:
254
- await client.blueprints.delete(
255
- id="id",
256
- )
257
-
258
-
259
- asyncio.run(main())
260
- """
261
- _response = await self._client_wrapper.httpx_client.request(
262
- f"api/blueprints/{jsonable_encoder(id)}/",
263
- method="DELETE",
264
- request_options=request_options,
265
- )
266
- try:
267
- if 200 <= _response.status_code < 300:
268
- return
269
- _response_json = _response.json()
270
- except JSONDecodeError:
271
- raise ApiError(status_code=_response.status_code, body=_response.text)
272
- raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- ProjectsListRequestFilter = typing.Union[typing.Literal["all", "exclude_pinned", "pinned_only"], typing.Any]
@@ -1,41 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from ..core.unchecked_base_model import UncheckedBaseModel
4
- import datetime as dt
5
- import typing
6
- import pydantic
7
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
-
9
-
10
- class Blueprint(UncheckedBaseModel):
11
- created_at: dt.datetime
12
- created_by: typing.Optional[int] = None
13
- description: typing.Optional[str] = pydantic.Field(default=None)
14
- """
15
- Project description
16
- """
17
-
18
- id: int
19
- label_config: typing.Optional[str] = pydantic.Field(default=None)
20
- """
21
- Labeling configuration in XML format
22
- """
23
-
24
- project: int
25
- share_id: str
26
- short_url: str
27
- title: typing.Optional[str] = pydantic.Field(default=None)
28
- """
29
- Blueprint name. Must be between 3 and 50 characters long.
30
- """
31
-
32
- updated_at: dt.datetime
33
-
34
- if IS_PYDANTIC_V2:
35
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
36
- else:
37
-
38
- class Config:
39
- frozen = True
40
- smart_union = True
41
- extra = pydantic.Extra.allow
@@ -1,7 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- from .role9e7enum import Role9E7Enum
5
- from .null_enum import NullEnum
6
-
7
- ConfigurablePermissionOptionDefault = typing.Union[Role9E7Enum, NullEnum]
@@ -1,7 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- from .sampling_enum import SamplingEnum
5
- from .null_enum import NullEnum
6
-
7
- ProjectSampling = typing.Union[SamplingEnum, NullEnum]