label-studio-sdk 1.0.0__py3-none-any.whl → 1.0.2__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.
- label_studio_sdk/__init__.py +46 -4
- label_studio_sdk/_extensions/pager_ext.py +49 -0
- label_studio_sdk/_legacy/schema/label_config_schema.json +14 -14
- label_studio_sdk/actions/__init__.py +27 -0
- label_studio_sdk/actions/client.py +129 -8
- label_studio_sdk/actions/types/__init__.py +27 -0
- label_studio_sdk/actions/types/actions_create_request_filters.py +43 -0
- label_studio_sdk/actions/types/actions_create_request_filters_conjunction.py +5 -0
- label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +50 -0
- label_studio_sdk/actions/types/actions_create_request_filters_items_item_filter.py +31 -0
- label_studio_sdk/actions/types/actions_create_request_filters_items_item_operator.py +23 -0
- label_studio_sdk/actions/types/actions_create_request_filters_items_item_value.py +5 -0
- label_studio_sdk/actions/types/actions_create_request_id.py +19 -0
- label_studio_sdk/actions/types/actions_create_request_ordering_item.py +31 -0
- label_studio_sdk/actions/types/actions_create_request_selected_items.py +10 -0
- label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +39 -0
- label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +39 -0
- label_studio_sdk/base_client.py +183 -0
- label_studio_sdk/client.py +17 -175
- label_studio_sdk/core/client_wrapper.py +1 -1
- label_studio_sdk/core/http_client.py +5 -1
- label_studio_sdk/errors/bad_request_error.py +3 -1
- label_studio_sdk/export_storage/azure/client.py +176 -10
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +15 -0
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +15 -0
- label_studio_sdk/export_storage/gcs/client.py +180 -14
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +16 -1
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +16 -1
- label_studio_sdk/export_storage/local/client.py +168 -22
- label_studio_sdk/export_storage/local/types/local_create_response.py +12 -2
- label_studio_sdk/export_storage/local/types/local_update_response.py +12 -2
- label_studio_sdk/export_storage/redis/client.py +234 -30
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +20 -5
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +20 -5
- label_studio_sdk/export_storage/s3/client.py +214 -26
- label_studio_sdk/export_storage/s3/types/s3create_response.py +15 -0
- label_studio_sdk/export_storage/s3/types/s3update_response.py +15 -0
- label_studio_sdk/import_storage/azure/client.py +266 -90
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +28 -18
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +28 -18
- label_studio_sdk/import_storage/gcs/client.py +270 -94
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +28 -18
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +28 -18
- label_studio_sdk/import_storage/local/client.py +168 -22
- label_studio_sdk/import_storage/local/types/local_create_response.py +12 -2
- label_studio_sdk/import_storage/local/types/local_update_response.py +12 -2
- label_studio_sdk/import_storage/redis/client.py +206 -50
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +20 -10
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +20 -10
- label_studio_sdk/import_storage/s3/client.py +336 -110
- label_studio_sdk/import_storage/s3/types/s3create_response.py +35 -25
- label_studio_sdk/import_storage/s3/types/s3update_response.py +35 -25
- label_studio_sdk/{_legacy/label_interface → label_interface}/base.py +10 -0
- label_studio_sdk/{_legacy/label_interface → label_interface}/control_tags.py +109 -71
- label_studio_sdk/{_legacy/label_interface → label_interface}/interface.py +97 -51
- label_studio_sdk/{_legacy/label_interface → label_interface}/object_tags.py +8 -13
- label_studio_sdk/label_interface/objects.py +60 -0
- label_studio_sdk/label_interface/region.py +75 -0
- label_studio_sdk/projects/client.py +6 -4
- label_studio_sdk/projects/client_ext.py +19 -0
- label_studio_sdk/tasks/client.py +35 -8
- label_studio_sdk/tasks/client_ext.py +18 -0
- label_studio_sdk/types/__init__.py +10 -0
- label_studio_sdk/types/annotation.py +5 -5
- label_studio_sdk/types/annotations_dm_field.py +120 -0
- label_studio_sdk/types/annotations_dm_field_last_action.py +19 -0
- label_studio_sdk/types/data_manager_task_serializer.py +123 -0
- label_studio_sdk/types/data_manager_task_serializer_drafts_item.py +31 -0
- label_studio_sdk/types/data_manager_task_serializer_predictions_item.py +37 -0
- label_studio_sdk/types/task.py +1 -1
- label_studio_sdk/views/__init__.py +12 -4
- label_studio_sdk/views/types/__init__.py +12 -4
- label_studio_sdk/views/types/views_create_request_data.py +2 -2
- label_studio_sdk/views/types/views_create_request_data_filters.py +5 -5
- label_studio_sdk/views/types/views_create_request_data_filters_conjunction.py +1 -1
- label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +11 -8
- label_studio_sdk/views/types/views_create_request_data_filters_items_item_filter.py +31 -0
- label_studio_sdk/views/types/views_create_request_data_filters_items_item_operator.py +23 -0
- label_studio_sdk/views/types/views_create_request_data_filters_items_item_value.py +5 -0
- label_studio_sdk/views/types/views_create_request_data_ordering_item.py +27 -34
- label_studio_sdk/views/types/views_update_request_data.py +2 -2
- label_studio_sdk/views/types/views_update_request_data_filters.py +5 -5
- label_studio_sdk/views/types/views_update_request_data_filters_conjunction.py +1 -1
- label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +11 -8
- label_studio_sdk/views/types/views_update_request_data_filters_items_item_filter.py +31 -0
- label_studio_sdk/views/types/views_update_request_data_filters_items_item_operator.py +23 -0
- label_studio_sdk/views/types/views_update_request_data_filters_items_item_value.py +5 -0
- label_studio_sdk/views/types/views_update_request_data_ordering_item.py +27 -34
- label_studio_sdk-1.0.2.dist-info/METADATA +195 -0
- {label_studio_sdk-1.0.0.dist-info → label_studio_sdk-1.0.2.dist-info}/RECORD +94 -69
- label_studio_sdk/_legacy/label_interface/region.py +0 -43
- label_studio_sdk/_legacy/objects.py +0 -35
- label_studio_sdk/views/types/views_create_request_data_ordering_item_direction.py +0 -5
- label_studio_sdk/views/types/views_update_request_data_ordering_item_direction.py +0 -5
- label_studio_sdk-1.0.0.dist-info/METADATA +0 -307
- /label_studio_sdk/{_legacy/label_interface → label_interface}/__init__.py +0 -0
- /label_studio_sdk/{_legacy/label_interface → label_interface}/data_examples.json +0 -0
- /label_studio_sdk/{_legacy/label_interface → label_interface}/label_tags.py +0 -0
- {label_studio_sdk-1.0.0.dist-info → label_studio_sdk-1.0.2.dist-info}/WHEEL +0 -0
|
@@ -8,49 +8,59 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class AzureUpdateResponse(pydantic_v1.BaseModel):
|
|
11
|
-
|
|
11
|
+
regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
12
12
|
"""
|
|
13
|
-
|
|
13
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
17
17
|
"""
|
|
18
|
-
|
|
18
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
presign: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
22
22
|
"""
|
|
23
|
-
|
|
23
|
+
Presign URLs for direct download
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
presign_ttl: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
Presign TTL in minutes
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
title: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
32
32
|
"""
|
|
33
|
-
|
|
33
|
+
Storage title
|
|
34
34
|
"""
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
description: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
37
37
|
"""
|
|
38
|
-
|
|
38
|
+
Storage description
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
project: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
42
42
|
"""
|
|
43
|
-
|
|
43
|
+
Project ID
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
container: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
47
47
|
"""
|
|
48
|
-
|
|
48
|
+
Azure blob container
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
52
52
|
"""
|
|
53
|
-
|
|
53
|
+
Azure blob prefix name
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
account_name: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
57
|
+
"""
|
|
58
|
+
Azure Blob account name
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
account_key: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
62
|
+
"""
|
|
63
|
+
Azure Blob account key
|
|
54
64
|
"""
|
|
55
65
|
|
|
56
66
|
def json(self, **kwargs: typing.Any) -> str:
|
|
@@ -66,15 +66,17 @@ class GcsClient:
|
|
|
66
66
|
def create(
|
|
67
67
|
self,
|
|
68
68
|
*,
|
|
69
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
70
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
71
|
+
presign: typing.Optional[bool] = OMIT,
|
|
72
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
73
|
+
title: typing.Optional[str] = OMIT,
|
|
74
|
+
description: typing.Optional[str] = OMIT,
|
|
69
75
|
project: typing.Optional[int] = OMIT,
|
|
70
76
|
bucket: typing.Optional[str] = OMIT,
|
|
71
77
|
prefix: typing.Optional[str] = OMIT,
|
|
72
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
73
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
74
78
|
google_application_credentials: typing.Optional[str] = OMIT,
|
|
75
79
|
google_project_id: typing.Optional[str] = OMIT,
|
|
76
|
-
presign: typing.Optional[bool] = OMIT,
|
|
77
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
78
80
|
request_options: typing.Optional[RequestOptions] = None,
|
|
79
81
|
) -> GcsCreateResponse:
|
|
80
82
|
"""
|
|
@@ -88,6 +90,24 @@ class GcsClient:
|
|
|
88
90
|
|
|
89
91
|
Parameters
|
|
90
92
|
----------
|
|
93
|
+
regex_filter : typing.Optional[str]
|
|
94
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
95
|
+
|
|
96
|
+
use_blob_urls : typing.Optional[bool]
|
|
97
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
98
|
+
|
|
99
|
+
presign : typing.Optional[bool]
|
|
100
|
+
Presign URLs for direct download
|
|
101
|
+
|
|
102
|
+
presign_ttl : typing.Optional[int]
|
|
103
|
+
Presign TTL in minutes
|
|
104
|
+
|
|
105
|
+
title : typing.Optional[str]
|
|
106
|
+
Storage title
|
|
107
|
+
|
|
108
|
+
description : typing.Optional[str]
|
|
109
|
+
Storage description
|
|
110
|
+
|
|
91
111
|
project : typing.Optional[int]
|
|
92
112
|
Project ID
|
|
93
113
|
|
|
@@ -97,24 +117,12 @@ class GcsClient:
|
|
|
97
117
|
prefix : typing.Optional[str]
|
|
98
118
|
GCS bucket prefix
|
|
99
119
|
|
|
100
|
-
regex_filter : typing.Optional[str]
|
|
101
|
-
Cloud storage regex for filtering objects
|
|
102
|
-
|
|
103
|
-
use_blob_urls : typing.Optional[bool]
|
|
104
|
-
Interpret objects as BLOBs and generate URLs
|
|
105
|
-
|
|
106
120
|
google_application_credentials : typing.Optional[str]
|
|
107
|
-
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
121
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
|
|
108
122
|
|
|
109
123
|
google_project_id : typing.Optional[str]
|
|
110
124
|
Google project ID
|
|
111
125
|
|
|
112
|
-
presign : typing.Optional[bool]
|
|
113
|
-
Presign URLs for direct download
|
|
114
|
-
|
|
115
|
-
presign_ttl : typing.Optional[int]
|
|
116
|
-
Presign TTL in minutes
|
|
117
|
-
|
|
118
126
|
request_options : typing.Optional[RequestOptions]
|
|
119
127
|
Request-specific configuration.
|
|
120
128
|
|
|
@@ -136,15 +144,17 @@ class GcsClient:
|
|
|
136
144
|
"api/storages/gcs/",
|
|
137
145
|
method="POST",
|
|
138
146
|
json={
|
|
147
|
+
"regex_filter": regex_filter,
|
|
148
|
+
"use_blob_urls": use_blob_urls,
|
|
149
|
+
"presign": presign,
|
|
150
|
+
"presign_ttl": presign_ttl,
|
|
151
|
+
"title": title,
|
|
152
|
+
"description": description,
|
|
139
153
|
"project": project,
|
|
140
154
|
"bucket": bucket,
|
|
141
155
|
"prefix": prefix,
|
|
142
|
-
"regex_filter": regex_filter,
|
|
143
|
-
"use_blob_urls": use_blob_urls,
|
|
144
156
|
"google_application_credentials": google_application_credentials,
|
|
145
157
|
"google_project_id": google_project_id,
|
|
146
|
-
"presign": presign,
|
|
147
|
-
"presign_ttl": presign_ttl,
|
|
148
158
|
},
|
|
149
159
|
request_options=request_options,
|
|
150
160
|
omit=OMIT,
|
|
@@ -157,19 +167,70 @@ class GcsClient:
|
|
|
157
167
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
158
168
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
159
169
|
|
|
160
|
-
def validate(
|
|
170
|
+
def validate(
|
|
171
|
+
self,
|
|
172
|
+
*,
|
|
173
|
+
id: typing.Optional[int] = OMIT,
|
|
174
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
175
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
176
|
+
presign: typing.Optional[bool] = OMIT,
|
|
177
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
178
|
+
title: typing.Optional[str] = OMIT,
|
|
179
|
+
description: typing.Optional[str] = OMIT,
|
|
180
|
+
project: typing.Optional[int] = OMIT,
|
|
181
|
+
bucket: typing.Optional[str] = OMIT,
|
|
182
|
+
prefix: typing.Optional[str] = OMIT,
|
|
183
|
+
google_application_credentials: typing.Optional[str] = OMIT,
|
|
184
|
+
google_project_id: typing.Optional[str] = OMIT,
|
|
185
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
186
|
+
) -> None:
|
|
161
187
|
"""
|
|
162
188
|
Validate a specific GCS import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
|
|
163
189
|
|
|
164
190
|
Parameters
|
|
165
191
|
----------
|
|
192
|
+
id : typing.Optional[int]
|
|
193
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
194
|
+
|
|
195
|
+
regex_filter : typing.Optional[str]
|
|
196
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
197
|
+
|
|
198
|
+
use_blob_urls : typing.Optional[bool]
|
|
199
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
200
|
+
|
|
201
|
+
presign : typing.Optional[bool]
|
|
202
|
+
Presign URLs for direct download
|
|
203
|
+
|
|
204
|
+
presign_ttl : typing.Optional[int]
|
|
205
|
+
Presign TTL in minutes
|
|
206
|
+
|
|
207
|
+
title : typing.Optional[str]
|
|
208
|
+
Storage title
|
|
209
|
+
|
|
210
|
+
description : typing.Optional[str]
|
|
211
|
+
Storage description
|
|
212
|
+
|
|
213
|
+
project : typing.Optional[int]
|
|
214
|
+
Project ID
|
|
215
|
+
|
|
216
|
+
bucket : typing.Optional[str]
|
|
217
|
+
GCS bucket name
|
|
218
|
+
|
|
219
|
+
prefix : typing.Optional[str]
|
|
220
|
+
GCS bucket prefix
|
|
221
|
+
|
|
222
|
+
google_application_credentials : typing.Optional[str]
|
|
223
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
|
|
224
|
+
|
|
225
|
+
google_project_id : typing.Optional[str]
|
|
226
|
+
Google project ID
|
|
227
|
+
|
|
166
228
|
request_options : typing.Optional[RequestOptions]
|
|
167
229
|
Request-specific configuration.
|
|
168
230
|
|
|
169
231
|
Returns
|
|
170
232
|
-------
|
|
171
|
-
|
|
172
|
-
|
|
233
|
+
None
|
|
173
234
|
|
|
174
235
|
Examples
|
|
175
236
|
--------
|
|
@@ -181,10 +242,27 @@ class GcsClient:
|
|
|
181
242
|
client.import_storage.gcs.validate()
|
|
182
243
|
"""
|
|
183
244
|
_response = self._client_wrapper.httpx_client.request(
|
|
184
|
-
"api/storages/gcs/validate",
|
|
245
|
+
"api/storages/gcs/validate",
|
|
246
|
+
method="POST",
|
|
247
|
+
json={
|
|
248
|
+
"id": id,
|
|
249
|
+
"regex_filter": regex_filter,
|
|
250
|
+
"use_blob_urls": use_blob_urls,
|
|
251
|
+
"presign": presign,
|
|
252
|
+
"presign_ttl": presign_ttl,
|
|
253
|
+
"title": title,
|
|
254
|
+
"description": description,
|
|
255
|
+
"project": project,
|
|
256
|
+
"bucket": bucket,
|
|
257
|
+
"prefix": prefix,
|
|
258
|
+
"google_application_credentials": google_application_credentials,
|
|
259
|
+
"google_project_id": google_project_id,
|
|
260
|
+
},
|
|
261
|
+
request_options=request_options,
|
|
262
|
+
omit=OMIT,
|
|
185
263
|
)
|
|
186
264
|
if 200 <= _response.status_code < 300:
|
|
187
|
-
return
|
|
265
|
+
return
|
|
188
266
|
try:
|
|
189
267
|
_response_json = _response.json()
|
|
190
268
|
except JSONDecodeError:
|
|
@@ -278,15 +356,17 @@ class GcsClient:
|
|
|
278
356
|
self,
|
|
279
357
|
id: int,
|
|
280
358
|
*,
|
|
359
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
360
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
361
|
+
presign: typing.Optional[bool] = OMIT,
|
|
362
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
363
|
+
title: typing.Optional[str] = OMIT,
|
|
364
|
+
description: typing.Optional[str] = OMIT,
|
|
281
365
|
project: typing.Optional[int] = OMIT,
|
|
282
366
|
bucket: typing.Optional[str] = OMIT,
|
|
283
367
|
prefix: typing.Optional[str] = OMIT,
|
|
284
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
285
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
286
368
|
google_application_credentials: typing.Optional[str] = OMIT,
|
|
287
369
|
google_project_id: typing.Optional[str] = OMIT,
|
|
288
|
-
presign: typing.Optional[bool] = OMIT,
|
|
289
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
290
370
|
request_options: typing.Optional[RequestOptions] = None,
|
|
291
371
|
) -> GcsUpdateResponse:
|
|
292
372
|
"""
|
|
@@ -299,6 +379,24 @@ class GcsClient:
|
|
|
299
379
|
id : int
|
|
300
380
|
A unique integer value identifying this gcs import storage.
|
|
301
381
|
|
|
382
|
+
regex_filter : typing.Optional[str]
|
|
383
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
384
|
+
|
|
385
|
+
use_blob_urls : typing.Optional[bool]
|
|
386
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
387
|
+
|
|
388
|
+
presign : typing.Optional[bool]
|
|
389
|
+
Presign URLs for direct download
|
|
390
|
+
|
|
391
|
+
presign_ttl : typing.Optional[int]
|
|
392
|
+
Presign TTL in minutes
|
|
393
|
+
|
|
394
|
+
title : typing.Optional[str]
|
|
395
|
+
Storage title
|
|
396
|
+
|
|
397
|
+
description : typing.Optional[str]
|
|
398
|
+
Storage description
|
|
399
|
+
|
|
302
400
|
project : typing.Optional[int]
|
|
303
401
|
Project ID
|
|
304
402
|
|
|
@@ -308,24 +406,12 @@ class GcsClient:
|
|
|
308
406
|
prefix : typing.Optional[str]
|
|
309
407
|
GCS bucket prefix
|
|
310
408
|
|
|
311
|
-
regex_filter : typing.Optional[str]
|
|
312
|
-
Cloud storage regex for filtering objects
|
|
313
|
-
|
|
314
|
-
use_blob_urls : typing.Optional[bool]
|
|
315
|
-
Interpret objects as BLOBs and generate URLs
|
|
316
|
-
|
|
317
409
|
google_application_credentials : typing.Optional[str]
|
|
318
|
-
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
410
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
|
|
319
411
|
|
|
320
412
|
google_project_id : typing.Optional[str]
|
|
321
413
|
Google project ID
|
|
322
414
|
|
|
323
|
-
presign : typing.Optional[bool]
|
|
324
|
-
Presign URLs for direct download
|
|
325
|
-
|
|
326
|
-
presign_ttl : typing.Optional[int]
|
|
327
|
-
Presign TTL in minutes
|
|
328
|
-
|
|
329
415
|
request_options : typing.Optional[RequestOptions]
|
|
330
416
|
Request-specific configuration.
|
|
331
417
|
|
|
@@ -349,15 +435,17 @@ class GcsClient:
|
|
|
349
435
|
f"api/storages/gcs/{jsonable_encoder(id)}",
|
|
350
436
|
method="PATCH",
|
|
351
437
|
json={
|
|
438
|
+
"regex_filter": regex_filter,
|
|
439
|
+
"use_blob_urls": use_blob_urls,
|
|
440
|
+
"presign": presign,
|
|
441
|
+
"presign_ttl": presign_ttl,
|
|
442
|
+
"title": title,
|
|
443
|
+
"description": description,
|
|
352
444
|
"project": project,
|
|
353
445
|
"bucket": bucket,
|
|
354
446
|
"prefix": prefix,
|
|
355
|
-
"regex_filter": regex_filter,
|
|
356
|
-
"use_blob_urls": use_blob_urls,
|
|
357
447
|
"google_application_credentials": google_application_credentials,
|
|
358
448
|
"google_project_id": google_project_id,
|
|
359
|
-
"presign": presign,
|
|
360
|
-
"presign_ttl": presign_ttl,
|
|
361
449
|
},
|
|
362
450
|
request_options=request_options,
|
|
363
451
|
omit=OMIT,
|
|
@@ -464,15 +552,17 @@ class AsyncGcsClient:
|
|
|
464
552
|
async def create(
|
|
465
553
|
self,
|
|
466
554
|
*,
|
|
555
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
556
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
557
|
+
presign: typing.Optional[bool] = OMIT,
|
|
558
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
559
|
+
title: typing.Optional[str] = OMIT,
|
|
560
|
+
description: typing.Optional[str] = OMIT,
|
|
467
561
|
project: typing.Optional[int] = OMIT,
|
|
468
562
|
bucket: typing.Optional[str] = OMIT,
|
|
469
563
|
prefix: typing.Optional[str] = OMIT,
|
|
470
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
471
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
472
564
|
google_application_credentials: typing.Optional[str] = OMIT,
|
|
473
565
|
google_project_id: typing.Optional[str] = OMIT,
|
|
474
|
-
presign: typing.Optional[bool] = OMIT,
|
|
475
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
476
566
|
request_options: typing.Optional[RequestOptions] = None,
|
|
477
567
|
) -> GcsCreateResponse:
|
|
478
568
|
"""
|
|
@@ -486,6 +576,24 @@ class AsyncGcsClient:
|
|
|
486
576
|
|
|
487
577
|
Parameters
|
|
488
578
|
----------
|
|
579
|
+
regex_filter : typing.Optional[str]
|
|
580
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
581
|
+
|
|
582
|
+
use_blob_urls : typing.Optional[bool]
|
|
583
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
584
|
+
|
|
585
|
+
presign : typing.Optional[bool]
|
|
586
|
+
Presign URLs for direct download
|
|
587
|
+
|
|
588
|
+
presign_ttl : typing.Optional[int]
|
|
589
|
+
Presign TTL in minutes
|
|
590
|
+
|
|
591
|
+
title : typing.Optional[str]
|
|
592
|
+
Storage title
|
|
593
|
+
|
|
594
|
+
description : typing.Optional[str]
|
|
595
|
+
Storage description
|
|
596
|
+
|
|
489
597
|
project : typing.Optional[int]
|
|
490
598
|
Project ID
|
|
491
599
|
|
|
@@ -495,24 +603,12 @@ class AsyncGcsClient:
|
|
|
495
603
|
prefix : typing.Optional[str]
|
|
496
604
|
GCS bucket prefix
|
|
497
605
|
|
|
498
|
-
regex_filter : typing.Optional[str]
|
|
499
|
-
Cloud storage regex for filtering objects
|
|
500
|
-
|
|
501
|
-
use_blob_urls : typing.Optional[bool]
|
|
502
|
-
Interpret objects as BLOBs and generate URLs
|
|
503
|
-
|
|
504
606
|
google_application_credentials : typing.Optional[str]
|
|
505
|
-
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
607
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
|
|
506
608
|
|
|
507
609
|
google_project_id : typing.Optional[str]
|
|
508
610
|
Google project ID
|
|
509
611
|
|
|
510
|
-
presign : typing.Optional[bool]
|
|
511
|
-
Presign URLs for direct download
|
|
512
|
-
|
|
513
|
-
presign_ttl : typing.Optional[int]
|
|
514
|
-
Presign TTL in minutes
|
|
515
|
-
|
|
516
612
|
request_options : typing.Optional[RequestOptions]
|
|
517
613
|
Request-specific configuration.
|
|
518
614
|
|
|
@@ -534,15 +630,17 @@ class AsyncGcsClient:
|
|
|
534
630
|
"api/storages/gcs/",
|
|
535
631
|
method="POST",
|
|
536
632
|
json={
|
|
633
|
+
"regex_filter": regex_filter,
|
|
634
|
+
"use_blob_urls": use_blob_urls,
|
|
635
|
+
"presign": presign,
|
|
636
|
+
"presign_ttl": presign_ttl,
|
|
637
|
+
"title": title,
|
|
638
|
+
"description": description,
|
|
537
639
|
"project": project,
|
|
538
640
|
"bucket": bucket,
|
|
539
641
|
"prefix": prefix,
|
|
540
|
-
"regex_filter": regex_filter,
|
|
541
|
-
"use_blob_urls": use_blob_urls,
|
|
542
642
|
"google_application_credentials": google_application_credentials,
|
|
543
643
|
"google_project_id": google_project_id,
|
|
544
|
-
"presign": presign,
|
|
545
|
-
"presign_ttl": presign_ttl,
|
|
546
644
|
},
|
|
547
645
|
request_options=request_options,
|
|
548
646
|
omit=OMIT,
|
|
@@ -555,19 +653,70 @@ class AsyncGcsClient:
|
|
|
555
653
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
556
654
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
557
655
|
|
|
558
|
-
async def validate(
|
|
656
|
+
async def validate(
|
|
657
|
+
self,
|
|
658
|
+
*,
|
|
659
|
+
id: typing.Optional[int] = OMIT,
|
|
660
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
661
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
662
|
+
presign: typing.Optional[bool] = OMIT,
|
|
663
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
664
|
+
title: typing.Optional[str] = OMIT,
|
|
665
|
+
description: typing.Optional[str] = OMIT,
|
|
666
|
+
project: typing.Optional[int] = OMIT,
|
|
667
|
+
bucket: typing.Optional[str] = OMIT,
|
|
668
|
+
prefix: typing.Optional[str] = OMIT,
|
|
669
|
+
google_application_credentials: typing.Optional[str] = OMIT,
|
|
670
|
+
google_project_id: typing.Optional[str] = OMIT,
|
|
671
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
672
|
+
) -> None:
|
|
559
673
|
"""
|
|
560
674
|
Validate a specific GCS import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
|
|
561
675
|
|
|
562
676
|
Parameters
|
|
563
677
|
----------
|
|
678
|
+
id : typing.Optional[int]
|
|
679
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
680
|
+
|
|
681
|
+
regex_filter : typing.Optional[str]
|
|
682
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
683
|
+
|
|
684
|
+
use_blob_urls : typing.Optional[bool]
|
|
685
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
686
|
+
|
|
687
|
+
presign : typing.Optional[bool]
|
|
688
|
+
Presign URLs for direct download
|
|
689
|
+
|
|
690
|
+
presign_ttl : typing.Optional[int]
|
|
691
|
+
Presign TTL in minutes
|
|
692
|
+
|
|
693
|
+
title : typing.Optional[str]
|
|
694
|
+
Storage title
|
|
695
|
+
|
|
696
|
+
description : typing.Optional[str]
|
|
697
|
+
Storage description
|
|
698
|
+
|
|
699
|
+
project : typing.Optional[int]
|
|
700
|
+
Project ID
|
|
701
|
+
|
|
702
|
+
bucket : typing.Optional[str]
|
|
703
|
+
GCS bucket name
|
|
704
|
+
|
|
705
|
+
prefix : typing.Optional[str]
|
|
706
|
+
GCS bucket prefix
|
|
707
|
+
|
|
708
|
+
google_application_credentials : typing.Optional[str]
|
|
709
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
|
|
710
|
+
|
|
711
|
+
google_project_id : typing.Optional[str]
|
|
712
|
+
Google project ID
|
|
713
|
+
|
|
564
714
|
request_options : typing.Optional[RequestOptions]
|
|
565
715
|
Request-specific configuration.
|
|
566
716
|
|
|
567
717
|
Returns
|
|
568
718
|
-------
|
|
569
|
-
|
|
570
|
-
|
|
719
|
+
None
|
|
571
720
|
|
|
572
721
|
Examples
|
|
573
722
|
--------
|
|
@@ -579,10 +728,27 @@ class AsyncGcsClient:
|
|
|
579
728
|
await client.import_storage.gcs.validate()
|
|
580
729
|
"""
|
|
581
730
|
_response = await self._client_wrapper.httpx_client.request(
|
|
582
|
-
"api/storages/gcs/validate",
|
|
731
|
+
"api/storages/gcs/validate",
|
|
732
|
+
method="POST",
|
|
733
|
+
json={
|
|
734
|
+
"id": id,
|
|
735
|
+
"regex_filter": regex_filter,
|
|
736
|
+
"use_blob_urls": use_blob_urls,
|
|
737
|
+
"presign": presign,
|
|
738
|
+
"presign_ttl": presign_ttl,
|
|
739
|
+
"title": title,
|
|
740
|
+
"description": description,
|
|
741
|
+
"project": project,
|
|
742
|
+
"bucket": bucket,
|
|
743
|
+
"prefix": prefix,
|
|
744
|
+
"google_application_credentials": google_application_credentials,
|
|
745
|
+
"google_project_id": google_project_id,
|
|
746
|
+
},
|
|
747
|
+
request_options=request_options,
|
|
748
|
+
omit=OMIT,
|
|
583
749
|
)
|
|
584
750
|
if 200 <= _response.status_code < 300:
|
|
585
|
-
return
|
|
751
|
+
return
|
|
586
752
|
try:
|
|
587
753
|
_response_json = _response.json()
|
|
588
754
|
except JSONDecodeError:
|
|
@@ -676,15 +842,17 @@ class AsyncGcsClient:
|
|
|
676
842
|
self,
|
|
677
843
|
id: int,
|
|
678
844
|
*,
|
|
845
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
846
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
847
|
+
presign: typing.Optional[bool] = OMIT,
|
|
848
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
849
|
+
title: typing.Optional[str] = OMIT,
|
|
850
|
+
description: typing.Optional[str] = OMIT,
|
|
679
851
|
project: typing.Optional[int] = OMIT,
|
|
680
852
|
bucket: typing.Optional[str] = OMIT,
|
|
681
853
|
prefix: typing.Optional[str] = OMIT,
|
|
682
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
683
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
684
854
|
google_application_credentials: typing.Optional[str] = OMIT,
|
|
685
855
|
google_project_id: typing.Optional[str] = OMIT,
|
|
686
|
-
presign: typing.Optional[bool] = OMIT,
|
|
687
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
688
856
|
request_options: typing.Optional[RequestOptions] = None,
|
|
689
857
|
) -> GcsUpdateResponse:
|
|
690
858
|
"""
|
|
@@ -697,6 +865,24 @@ class AsyncGcsClient:
|
|
|
697
865
|
id : int
|
|
698
866
|
A unique integer value identifying this gcs import storage.
|
|
699
867
|
|
|
868
|
+
regex_filter : typing.Optional[str]
|
|
869
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
870
|
+
|
|
871
|
+
use_blob_urls : typing.Optional[bool]
|
|
872
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
873
|
+
|
|
874
|
+
presign : typing.Optional[bool]
|
|
875
|
+
Presign URLs for direct download
|
|
876
|
+
|
|
877
|
+
presign_ttl : typing.Optional[int]
|
|
878
|
+
Presign TTL in minutes
|
|
879
|
+
|
|
880
|
+
title : typing.Optional[str]
|
|
881
|
+
Storage title
|
|
882
|
+
|
|
883
|
+
description : typing.Optional[str]
|
|
884
|
+
Storage description
|
|
885
|
+
|
|
700
886
|
project : typing.Optional[int]
|
|
701
887
|
Project ID
|
|
702
888
|
|
|
@@ -706,24 +892,12 @@ class AsyncGcsClient:
|
|
|
706
892
|
prefix : typing.Optional[str]
|
|
707
893
|
GCS bucket prefix
|
|
708
894
|
|
|
709
|
-
regex_filter : typing.Optional[str]
|
|
710
|
-
Cloud storage regex for filtering objects
|
|
711
|
-
|
|
712
|
-
use_blob_urls : typing.Optional[bool]
|
|
713
|
-
Interpret objects as BLOBs and generate URLs
|
|
714
|
-
|
|
715
895
|
google_application_credentials : typing.Optional[str]
|
|
716
|
-
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
896
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
|
|
717
897
|
|
|
718
898
|
google_project_id : typing.Optional[str]
|
|
719
899
|
Google project ID
|
|
720
900
|
|
|
721
|
-
presign : typing.Optional[bool]
|
|
722
|
-
Presign URLs for direct download
|
|
723
|
-
|
|
724
|
-
presign_ttl : typing.Optional[int]
|
|
725
|
-
Presign TTL in minutes
|
|
726
|
-
|
|
727
901
|
request_options : typing.Optional[RequestOptions]
|
|
728
902
|
Request-specific configuration.
|
|
729
903
|
|
|
@@ -747,15 +921,17 @@ class AsyncGcsClient:
|
|
|
747
921
|
f"api/storages/gcs/{jsonable_encoder(id)}",
|
|
748
922
|
method="PATCH",
|
|
749
923
|
json={
|
|
924
|
+
"regex_filter": regex_filter,
|
|
925
|
+
"use_blob_urls": use_blob_urls,
|
|
926
|
+
"presign": presign,
|
|
927
|
+
"presign_ttl": presign_ttl,
|
|
928
|
+
"title": title,
|
|
929
|
+
"description": description,
|
|
750
930
|
"project": project,
|
|
751
931
|
"bucket": bucket,
|
|
752
932
|
"prefix": prefix,
|
|
753
|
-
"regex_filter": regex_filter,
|
|
754
|
-
"use_blob_urls": use_blob_urls,
|
|
755
933
|
"google_application_credentials": google_application_credentials,
|
|
756
934
|
"google_project_id": google_project_id,
|
|
757
|
-
"presign": presign,
|
|
758
|
-
"presign_ttl": presign_ttl,
|
|
759
935
|
},
|
|
760
936
|
request_options=request_options,
|
|
761
937
|
omit=OMIT,
|