label-studio-sdk 1.0.0__py3-none-any.whl → 1.0.1__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 +30 -4
- label_studio_sdk/_extensions/pager_ext.py +49 -0
- label_studio_sdk/_legacy/objects.py +46 -7
- label_studio_sdk/_legacy/schema/label_config_schema.json +14 -14
- label_studio_sdk/actions/__init__.py +25 -0
- label_studio_sdk/actions/client.py +79 -6
- label_studio_sdk/actions/types/__init__.py +25 -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 +49 -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_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/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 +96 -50
- label_studio_sdk/{_legacy/label_interface → label_interface}/object_tags.py +8 -13
- label_studio_sdk/label_interface/region.py +75 -0
- label_studio_sdk/projects/client.py +4 -2
- label_studio_sdk/projects/client_ext.py +19 -0
- label_studio_sdk/tasks/client.py +26 -2
- label_studio_sdk/tasks/client_ext.py +18 -0
- label_studio_sdk/types/annotation.py +5 -5
- label_studio_sdk/types/task.py +1 -1
- label_studio_sdk/views/__init__.py +8 -4
- label_studio_sdk/views/types/__init__.py +8 -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 +10 -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_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 +10 -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_ordering_item.py +27 -34
- {label_studio_sdk-1.0.0.dist-info → label_studio_sdk-1.0.1.dist-info}/METADATA +17 -161
- {label_studio_sdk-1.0.0.dist-info → label_studio_sdk-1.0.1.dist-info}/RECORD +84 -67
- label_studio_sdk/_legacy/label_interface/region.py +0 -43
- 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/{_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.1.dist-info}/WHEEL +0 -0
|
@@ -66,13 +66,15 @@ class RedisClient:
|
|
|
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
|
+
title: typing.Optional[str] = OMIT,
|
|
72
|
+
description: typing.Optional[str] = OMIT,
|
|
69
73
|
project: typing.Optional[int] = OMIT,
|
|
70
74
|
path: typing.Optional[str] = OMIT,
|
|
71
75
|
host: typing.Optional[str] = OMIT,
|
|
72
76
|
port: typing.Optional[str] = OMIT,
|
|
73
77
|
password: typing.Optional[str] = OMIT,
|
|
74
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
75
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
76
78
|
request_options: typing.Optional[RequestOptions] = None,
|
|
77
79
|
) -> RedisCreateResponse:
|
|
78
80
|
"""
|
|
@@ -84,6 +86,18 @@ class RedisClient:
|
|
|
84
86
|
|
|
85
87
|
Parameters
|
|
86
88
|
----------
|
|
89
|
+
regex_filter : typing.Optional[str]
|
|
90
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
91
|
+
|
|
92
|
+
use_blob_urls : typing.Optional[bool]
|
|
93
|
+
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.
|
|
94
|
+
|
|
95
|
+
title : typing.Optional[str]
|
|
96
|
+
Storage title
|
|
97
|
+
|
|
98
|
+
description : typing.Optional[str]
|
|
99
|
+
Storage description
|
|
100
|
+
|
|
87
101
|
project : typing.Optional[int]
|
|
88
102
|
Project ID
|
|
89
103
|
|
|
@@ -99,12 +113,6 @@ class RedisClient:
|
|
|
99
113
|
password : typing.Optional[str]
|
|
100
114
|
Server Password (optional)
|
|
101
115
|
|
|
102
|
-
regex_filter : typing.Optional[str]
|
|
103
|
-
Cloud storage regex for filtering objects
|
|
104
|
-
|
|
105
|
-
use_blob_urls : typing.Optional[bool]
|
|
106
|
-
Interpret objects as BLOBs and generate URLs
|
|
107
|
-
|
|
108
116
|
request_options : typing.Optional[RequestOptions]
|
|
109
117
|
Request-specific configuration.
|
|
110
118
|
|
|
@@ -126,13 +134,15 @@ class RedisClient:
|
|
|
126
134
|
"api/storages/redis/",
|
|
127
135
|
method="POST",
|
|
128
136
|
json={
|
|
137
|
+
"regex_filter": regex_filter,
|
|
138
|
+
"use_blob_urls": use_blob_urls,
|
|
139
|
+
"title": title,
|
|
140
|
+
"description": description,
|
|
129
141
|
"project": project,
|
|
130
142
|
"path": path,
|
|
131
143
|
"host": host,
|
|
132
144
|
"port": port,
|
|
133
145
|
"password": password,
|
|
134
|
-
"regex_filter": regex_filter,
|
|
135
|
-
"use_blob_urls": use_blob_urls,
|
|
136
146
|
},
|
|
137
147
|
request_options=request_options,
|
|
138
148
|
omit=OMIT,
|
|
@@ -145,19 +155,62 @@ class RedisClient:
|
|
|
145
155
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
146
156
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
147
157
|
|
|
148
|
-
def validate(
|
|
158
|
+
def validate(
|
|
159
|
+
self,
|
|
160
|
+
*,
|
|
161
|
+
id: typing.Optional[int] = OMIT,
|
|
162
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
163
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
164
|
+
title: typing.Optional[str] = OMIT,
|
|
165
|
+
description: typing.Optional[str] = OMIT,
|
|
166
|
+
project: typing.Optional[int] = OMIT,
|
|
167
|
+
path: typing.Optional[str] = OMIT,
|
|
168
|
+
host: typing.Optional[str] = OMIT,
|
|
169
|
+
port: typing.Optional[str] = OMIT,
|
|
170
|
+
password: typing.Optional[str] = OMIT,
|
|
171
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
172
|
+
) -> None:
|
|
149
173
|
"""
|
|
150
174
|
Validate a specific Redis import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
|
|
151
175
|
|
|
152
176
|
Parameters
|
|
153
177
|
----------
|
|
178
|
+
id : typing.Optional[int]
|
|
179
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
180
|
+
|
|
181
|
+
regex_filter : typing.Optional[str]
|
|
182
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
183
|
+
|
|
184
|
+
use_blob_urls : typing.Optional[bool]
|
|
185
|
+
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.
|
|
186
|
+
|
|
187
|
+
title : typing.Optional[str]
|
|
188
|
+
Storage title
|
|
189
|
+
|
|
190
|
+
description : typing.Optional[str]
|
|
191
|
+
Storage description
|
|
192
|
+
|
|
193
|
+
project : typing.Optional[int]
|
|
194
|
+
Project ID
|
|
195
|
+
|
|
196
|
+
path : typing.Optional[str]
|
|
197
|
+
Storage prefix (optional)
|
|
198
|
+
|
|
199
|
+
host : typing.Optional[str]
|
|
200
|
+
Server Host IP (optional)
|
|
201
|
+
|
|
202
|
+
port : typing.Optional[str]
|
|
203
|
+
Server Port (optional)
|
|
204
|
+
|
|
205
|
+
password : typing.Optional[str]
|
|
206
|
+
Server Password (optional)
|
|
207
|
+
|
|
154
208
|
request_options : typing.Optional[RequestOptions]
|
|
155
209
|
Request-specific configuration.
|
|
156
210
|
|
|
157
211
|
Returns
|
|
158
212
|
-------
|
|
159
|
-
|
|
160
|
-
|
|
213
|
+
None
|
|
161
214
|
|
|
162
215
|
Examples
|
|
163
216
|
--------
|
|
@@ -169,10 +222,25 @@ class RedisClient:
|
|
|
169
222
|
client.import_storage.redis.validate()
|
|
170
223
|
"""
|
|
171
224
|
_response = self._client_wrapper.httpx_client.request(
|
|
172
|
-
"api/storages/redis/validate",
|
|
225
|
+
"api/storages/redis/validate",
|
|
226
|
+
method="POST",
|
|
227
|
+
json={
|
|
228
|
+
"id": id,
|
|
229
|
+
"regex_filter": regex_filter,
|
|
230
|
+
"use_blob_urls": use_blob_urls,
|
|
231
|
+
"title": title,
|
|
232
|
+
"description": description,
|
|
233
|
+
"project": project,
|
|
234
|
+
"path": path,
|
|
235
|
+
"host": host,
|
|
236
|
+
"port": port,
|
|
237
|
+
"password": password,
|
|
238
|
+
},
|
|
239
|
+
request_options=request_options,
|
|
240
|
+
omit=OMIT,
|
|
173
241
|
)
|
|
174
242
|
if 200 <= _response.status_code < 300:
|
|
175
|
-
return
|
|
243
|
+
return
|
|
176
244
|
try:
|
|
177
245
|
_response_json = _response.json()
|
|
178
246
|
except JSONDecodeError:
|
|
@@ -266,13 +334,15 @@ class RedisClient:
|
|
|
266
334
|
self,
|
|
267
335
|
id: int,
|
|
268
336
|
*,
|
|
337
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
338
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
339
|
+
title: typing.Optional[str] = OMIT,
|
|
340
|
+
description: typing.Optional[str] = OMIT,
|
|
269
341
|
project: typing.Optional[int] = OMIT,
|
|
270
342
|
path: typing.Optional[str] = OMIT,
|
|
271
343
|
host: typing.Optional[str] = OMIT,
|
|
272
344
|
port: typing.Optional[str] = OMIT,
|
|
273
345
|
password: typing.Optional[str] = OMIT,
|
|
274
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
275
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
276
346
|
request_options: typing.Optional[RequestOptions] = None,
|
|
277
347
|
) -> RedisUpdateResponse:
|
|
278
348
|
"""
|
|
@@ -285,6 +355,18 @@ class RedisClient:
|
|
|
285
355
|
id : int
|
|
286
356
|
A unique integer value identifying this redis import storage.
|
|
287
357
|
|
|
358
|
+
regex_filter : typing.Optional[str]
|
|
359
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
360
|
+
|
|
361
|
+
use_blob_urls : typing.Optional[bool]
|
|
362
|
+
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.
|
|
363
|
+
|
|
364
|
+
title : typing.Optional[str]
|
|
365
|
+
Storage title
|
|
366
|
+
|
|
367
|
+
description : typing.Optional[str]
|
|
368
|
+
Storage description
|
|
369
|
+
|
|
288
370
|
project : typing.Optional[int]
|
|
289
371
|
Project ID
|
|
290
372
|
|
|
@@ -300,12 +382,6 @@ class RedisClient:
|
|
|
300
382
|
password : typing.Optional[str]
|
|
301
383
|
Server Password (optional)
|
|
302
384
|
|
|
303
|
-
regex_filter : typing.Optional[str]
|
|
304
|
-
Cloud storage regex for filtering objects
|
|
305
|
-
|
|
306
|
-
use_blob_urls : typing.Optional[bool]
|
|
307
|
-
Interpret objects as BLOBs and generate URLs
|
|
308
|
-
|
|
309
385
|
request_options : typing.Optional[RequestOptions]
|
|
310
386
|
Request-specific configuration.
|
|
311
387
|
|
|
@@ -329,13 +405,15 @@ class RedisClient:
|
|
|
329
405
|
f"api/storages/redis/{jsonable_encoder(id)}",
|
|
330
406
|
method="PATCH",
|
|
331
407
|
json={
|
|
408
|
+
"regex_filter": regex_filter,
|
|
409
|
+
"use_blob_urls": use_blob_urls,
|
|
410
|
+
"title": title,
|
|
411
|
+
"description": description,
|
|
332
412
|
"project": project,
|
|
333
413
|
"path": path,
|
|
334
414
|
"host": host,
|
|
335
415
|
"port": port,
|
|
336
416
|
"password": password,
|
|
337
|
-
"regex_filter": regex_filter,
|
|
338
|
-
"use_blob_urls": use_blob_urls,
|
|
339
417
|
},
|
|
340
418
|
request_options=request_options,
|
|
341
419
|
omit=OMIT,
|
|
@@ -442,13 +520,15 @@ class AsyncRedisClient:
|
|
|
442
520
|
async def create(
|
|
443
521
|
self,
|
|
444
522
|
*,
|
|
523
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
524
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
525
|
+
title: typing.Optional[str] = OMIT,
|
|
526
|
+
description: typing.Optional[str] = OMIT,
|
|
445
527
|
project: typing.Optional[int] = OMIT,
|
|
446
528
|
path: typing.Optional[str] = OMIT,
|
|
447
529
|
host: typing.Optional[str] = OMIT,
|
|
448
530
|
port: typing.Optional[str] = OMIT,
|
|
449
531
|
password: typing.Optional[str] = OMIT,
|
|
450
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
451
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
452
532
|
request_options: typing.Optional[RequestOptions] = None,
|
|
453
533
|
) -> RedisCreateResponse:
|
|
454
534
|
"""
|
|
@@ -460,6 +540,18 @@ class AsyncRedisClient:
|
|
|
460
540
|
|
|
461
541
|
Parameters
|
|
462
542
|
----------
|
|
543
|
+
regex_filter : typing.Optional[str]
|
|
544
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
545
|
+
|
|
546
|
+
use_blob_urls : typing.Optional[bool]
|
|
547
|
+
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.
|
|
548
|
+
|
|
549
|
+
title : typing.Optional[str]
|
|
550
|
+
Storage title
|
|
551
|
+
|
|
552
|
+
description : typing.Optional[str]
|
|
553
|
+
Storage description
|
|
554
|
+
|
|
463
555
|
project : typing.Optional[int]
|
|
464
556
|
Project ID
|
|
465
557
|
|
|
@@ -475,12 +567,6 @@ class AsyncRedisClient:
|
|
|
475
567
|
password : typing.Optional[str]
|
|
476
568
|
Server Password (optional)
|
|
477
569
|
|
|
478
|
-
regex_filter : typing.Optional[str]
|
|
479
|
-
Cloud storage regex for filtering objects
|
|
480
|
-
|
|
481
|
-
use_blob_urls : typing.Optional[bool]
|
|
482
|
-
Interpret objects as BLOBs and generate URLs
|
|
483
|
-
|
|
484
570
|
request_options : typing.Optional[RequestOptions]
|
|
485
571
|
Request-specific configuration.
|
|
486
572
|
|
|
@@ -502,13 +588,15 @@ class AsyncRedisClient:
|
|
|
502
588
|
"api/storages/redis/",
|
|
503
589
|
method="POST",
|
|
504
590
|
json={
|
|
591
|
+
"regex_filter": regex_filter,
|
|
592
|
+
"use_blob_urls": use_blob_urls,
|
|
593
|
+
"title": title,
|
|
594
|
+
"description": description,
|
|
505
595
|
"project": project,
|
|
506
596
|
"path": path,
|
|
507
597
|
"host": host,
|
|
508
598
|
"port": port,
|
|
509
599
|
"password": password,
|
|
510
|
-
"regex_filter": regex_filter,
|
|
511
|
-
"use_blob_urls": use_blob_urls,
|
|
512
600
|
},
|
|
513
601
|
request_options=request_options,
|
|
514
602
|
omit=OMIT,
|
|
@@ -521,19 +609,62 @@ class AsyncRedisClient:
|
|
|
521
609
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
522
610
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
523
611
|
|
|
524
|
-
async def validate(
|
|
612
|
+
async def validate(
|
|
613
|
+
self,
|
|
614
|
+
*,
|
|
615
|
+
id: typing.Optional[int] = OMIT,
|
|
616
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
617
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
618
|
+
title: typing.Optional[str] = OMIT,
|
|
619
|
+
description: typing.Optional[str] = OMIT,
|
|
620
|
+
project: typing.Optional[int] = OMIT,
|
|
621
|
+
path: typing.Optional[str] = OMIT,
|
|
622
|
+
host: typing.Optional[str] = OMIT,
|
|
623
|
+
port: typing.Optional[str] = OMIT,
|
|
624
|
+
password: typing.Optional[str] = OMIT,
|
|
625
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
626
|
+
) -> None:
|
|
525
627
|
"""
|
|
526
628
|
Validate a specific Redis import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
|
|
527
629
|
|
|
528
630
|
Parameters
|
|
529
631
|
----------
|
|
632
|
+
id : typing.Optional[int]
|
|
633
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
634
|
+
|
|
635
|
+
regex_filter : typing.Optional[str]
|
|
636
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
637
|
+
|
|
638
|
+
use_blob_urls : typing.Optional[bool]
|
|
639
|
+
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.
|
|
640
|
+
|
|
641
|
+
title : typing.Optional[str]
|
|
642
|
+
Storage title
|
|
643
|
+
|
|
644
|
+
description : typing.Optional[str]
|
|
645
|
+
Storage description
|
|
646
|
+
|
|
647
|
+
project : typing.Optional[int]
|
|
648
|
+
Project ID
|
|
649
|
+
|
|
650
|
+
path : typing.Optional[str]
|
|
651
|
+
Storage prefix (optional)
|
|
652
|
+
|
|
653
|
+
host : typing.Optional[str]
|
|
654
|
+
Server Host IP (optional)
|
|
655
|
+
|
|
656
|
+
port : typing.Optional[str]
|
|
657
|
+
Server Port (optional)
|
|
658
|
+
|
|
659
|
+
password : typing.Optional[str]
|
|
660
|
+
Server Password (optional)
|
|
661
|
+
|
|
530
662
|
request_options : typing.Optional[RequestOptions]
|
|
531
663
|
Request-specific configuration.
|
|
532
664
|
|
|
533
665
|
Returns
|
|
534
666
|
-------
|
|
535
|
-
|
|
536
|
-
|
|
667
|
+
None
|
|
537
668
|
|
|
538
669
|
Examples
|
|
539
670
|
--------
|
|
@@ -545,10 +676,25 @@ class AsyncRedisClient:
|
|
|
545
676
|
await client.import_storage.redis.validate()
|
|
546
677
|
"""
|
|
547
678
|
_response = await self._client_wrapper.httpx_client.request(
|
|
548
|
-
"api/storages/redis/validate",
|
|
679
|
+
"api/storages/redis/validate",
|
|
680
|
+
method="POST",
|
|
681
|
+
json={
|
|
682
|
+
"id": id,
|
|
683
|
+
"regex_filter": regex_filter,
|
|
684
|
+
"use_blob_urls": use_blob_urls,
|
|
685
|
+
"title": title,
|
|
686
|
+
"description": description,
|
|
687
|
+
"project": project,
|
|
688
|
+
"path": path,
|
|
689
|
+
"host": host,
|
|
690
|
+
"port": port,
|
|
691
|
+
"password": password,
|
|
692
|
+
},
|
|
693
|
+
request_options=request_options,
|
|
694
|
+
omit=OMIT,
|
|
549
695
|
)
|
|
550
696
|
if 200 <= _response.status_code < 300:
|
|
551
|
-
return
|
|
697
|
+
return
|
|
552
698
|
try:
|
|
553
699
|
_response_json = _response.json()
|
|
554
700
|
except JSONDecodeError:
|
|
@@ -642,13 +788,15 @@ class AsyncRedisClient:
|
|
|
642
788
|
self,
|
|
643
789
|
id: int,
|
|
644
790
|
*,
|
|
791
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
792
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
793
|
+
title: typing.Optional[str] = OMIT,
|
|
794
|
+
description: typing.Optional[str] = OMIT,
|
|
645
795
|
project: typing.Optional[int] = OMIT,
|
|
646
796
|
path: typing.Optional[str] = OMIT,
|
|
647
797
|
host: typing.Optional[str] = OMIT,
|
|
648
798
|
port: typing.Optional[str] = OMIT,
|
|
649
799
|
password: typing.Optional[str] = OMIT,
|
|
650
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
651
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
652
800
|
request_options: typing.Optional[RequestOptions] = None,
|
|
653
801
|
) -> RedisUpdateResponse:
|
|
654
802
|
"""
|
|
@@ -661,6 +809,18 @@ class AsyncRedisClient:
|
|
|
661
809
|
id : int
|
|
662
810
|
A unique integer value identifying this redis import storage.
|
|
663
811
|
|
|
812
|
+
regex_filter : typing.Optional[str]
|
|
813
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
814
|
+
|
|
815
|
+
use_blob_urls : typing.Optional[bool]
|
|
816
|
+
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.
|
|
817
|
+
|
|
818
|
+
title : typing.Optional[str]
|
|
819
|
+
Storage title
|
|
820
|
+
|
|
821
|
+
description : typing.Optional[str]
|
|
822
|
+
Storage description
|
|
823
|
+
|
|
664
824
|
project : typing.Optional[int]
|
|
665
825
|
Project ID
|
|
666
826
|
|
|
@@ -676,12 +836,6 @@ class AsyncRedisClient:
|
|
|
676
836
|
password : typing.Optional[str]
|
|
677
837
|
Server Password (optional)
|
|
678
838
|
|
|
679
|
-
regex_filter : typing.Optional[str]
|
|
680
|
-
Cloud storage regex for filtering objects
|
|
681
|
-
|
|
682
|
-
use_blob_urls : typing.Optional[bool]
|
|
683
|
-
Interpret objects as BLOBs and generate URLs
|
|
684
|
-
|
|
685
839
|
request_options : typing.Optional[RequestOptions]
|
|
686
840
|
Request-specific configuration.
|
|
687
841
|
|
|
@@ -705,13 +859,15 @@ class AsyncRedisClient:
|
|
|
705
859
|
f"api/storages/redis/{jsonable_encoder(id)}",
|
|
706
860
|
method="PATCH",
|
|
707
861
|
json={
|
|
862
|
+
"regex_filter": regex_filter,
|
|
863
|
+
"use_blob_urls": use_blob_urls,
|
|
864
|
+
"title": title,
|
|
865
|
+
"description": description,
|
|
708
866
|
"project": project,
|
|
709
867
|
"path": path,
|
|
710
868
|
"host": host,
|
|
711
869
|
"port": port,
|
|
712
870
|
"password": password,
|
|
713
|
-
"regex_filter": regex_filter,
|
|
714
|
-
"use_blob_urls": use_blob_urls,
|
|
715
871
|
},
|
|
716
872
|
request_options=request_options,
|
|
717
873
|
omit=OMIT,
|
|
@@ -8,6 +8,26 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class RedisCreateResponse(pydantic_v1.BaseModel):
|
|
11
|
+
regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
12
|
+
"""
|
|
13
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
17
|
+
"""
|
|
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
|
+
"""
|
|
20
|
+
|
|
21
|
+
title: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Storage title
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
description: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
Storage description
|
|
29
|
+
"""
|
|
30
|
+
|
|
11
31
|
project: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
12
32
|
"""
|
|
13
33
|
Project ID
|
|
@@ -33,16 +53,6 @@ class RedisCreateResponse(pydantic_v1.BaseModel):
|
|
|
33
53
|
Server Password (optional)
|
|
34
54
|
"""
|
|
35
55
|
|
|
36
|
-
regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
37
|
-
"""
|
|
38
|
-
Cloud storage regex for filtering objects
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
42
|
-
"""
|
|
43
|
-
Interpret objects as BLOBs and generate URLs
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
56
|
def json(self, **kwargs: typing.Any) -> str:
|
|
47
57
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
48
58
|
return super().json(**kwargs_with_defaults)
|
|
@@ -8,6 +8,26 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class RedisUpdateResponse(pydantic_v1.BaseModel):
|
|
11
|
+
regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
12
|
+
"""
|
|
13
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
17
|
+
"""
|
|
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
|
+
"""
|
|
20
|
+
|
|
21
|
+
title: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Storage title
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
description: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
Storage description
|
|
29
|
+
"""
|
|
30
|
+
|
|
11
31
|
project: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
12
32
|
"""
|
|
13
33
|
Project ID
|
|
@@ -33,16 +53,6 @@ class RedisUpdateResponse(pydantic_v1.BaseModel):
|
|
|
33
53
|
Server Password (optional)
|
|
34
54
|
"""
|
|
35
55
|
|
|
36
|
-
regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
37
|
-
"""
|
|
38
|
-
Cloud storage regex for filtering objects
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
42
|
-
"""
|
|
43
|
-
Interpret objects as BLOBs and generate URLs
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
56
|
def json(self, **kwargs: typing.Any) -> str:
|
|
47
57
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
48
58
|
return super().json(**kwargs_with_defaults)
|