label-studio-sdk 0.0.34__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 +232 -9
- label_studio_sdk/_extensions/label_studio_tools/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/core/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/core/label_config.py +163 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/exceptions.py +2 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py +228 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/params.py +45 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/__init__.py +1 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/beam.py +34 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/example.py +17 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/registry.py +67 -0
- label_studio_sdk/_extensions/label_studio_tools/postprocessing/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/postprocessing/video.py +97 -0
- label_studio_sdk/_extensions/pager_ext.py +49 -0
- label_studio_sdk/_legacy/__init__.py +11 -0
- label_studio_sdk/_legacy/client.py +471 -0
- label_studio_sdk/_legacy/objects.py +74 -0
- label_studio_sdk/{project.py → _legacy/project.py} +2 -2
- label_studio_sdk/{schema → _legacy/schema}/label_config_schema.json +14 -14
- label_studio_sdk/actions/__init__.py +27 -0
- label_studio_sdk/actions/client.py +223 -0
- 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/annotations/__init__.py +2 -0
- label_studio_sdk/annotations/client.py +750 -0
- label_studio_sdk/base_client.py +183 -0
- label_studio_sdk/client.py +17 -463
- label_studio_sdk/converter/__init__.py +7 -0
- label_studio_sdk/converter/audio.py +56 -0
- label_studio_sdk/converter/brush.py +452 -0
- label_studio_sdk/converter/converter.py +1175 -0
- label_studio_sdk/converter/exports/__init__.py +0 -0
- label_studio_sdk/converter/exports/csv.py +82 -0
- label_studio_sdk/converter/exports/csv2.py +103 -0
- label_studio_sdk/converter/funsd.py +85 -0
- label_studio_sdk/converter/imports/__init__.py +0 -0
- label_studio_sdk/converter/imports/coco.py +314 -0
- label_studio_sdk/converter/imports/colors.py +198 -0
- label_studio_sdk/converter/imports/label_config.py +45 -0
- label_studio_sdk/converter/imports/pathtrack.py +269 -0
- label_studio_sdk/converter/imports/yolo.py +236 -0
- label_studio_sdk/converter/main.py +202 -0
- label_studio_sdk/converter/utils.py +473 -0
- label_studio_sdk/core/__init__.py +33 -0
- label_studio_sdk/core/api_error.py +15 -0
- label_studio_sdk/core/client_wrapper.py +55 -0
- label_studio_sdk/core/datetime_utils.py +28 -0
- label_studio_sdk/core/file.py +38 -0
- label_studio_sdk/core/http_client.py +447 -0
- label_studio_sdk/core/jsonable_encoder.py +99 -0
- label_studio_sdk/core/pagination.py +87 -0
- label_studio_sdk/core/pydantic_utilities.py +28 -0
- label_studio_sdk/core/query_encoder.py +33 -0
- label_studio_sdk/core/remove_none_from_dict.py +11 -0
- label_studio_sdk/core/request_options.py +32 -0
- label_studio_sdk/environment.py +7 -0
- label_studio_sdk/errors/__init__.py +6 -0
- label_studio_sdk/errors/bad_request_error.py +8 -0
- label_studio_sdk/errors/internal_server_error.py +8 -0
- label_studio_sdk/export_storage/__init__.py +28 -0
- label_studio_sdk/export_storage/azure/__init__.py +5 -0
- label_studio_sdk/export_storage/azure/client.py +888 -0
- label_studio_sdk/export_storage/azure/types/__init__.py +6 -0
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +67 -0
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +67 -0
- label_studio_sdk/export_storage/client.py +107 -0
- label_studio_sdk/export_storage/gcs/__init__.py +5 -0
- label_studio_sdk/export_storage/gcs/client.py +888 -0
- label_studio_sdk/export_storage/gcs/types/__init__.py +6 -0
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +67 -0
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +67 -0
- label_studio_sdk/export_storage/local/__init__.py +5 -0
- label_studio_sdk/export_storage/local/client.py +834 -0
- label_studio_sdk/export_storage/local/types/__init__.py +6 -0
- label_studio_sdk/export_storage/local/types/local_create_response.py +57 -0
- label_studio_sdk/export_storage/local/types/local_update_response.py +57 -0
- label_studio_sdk/export_storage/redis/__init__.py +5 -0
- label_studio_sdk/export_storage/redis/client.py +918 -0
- label_studio_sdk/export_storage/redis/types/__init__.py +6 -0
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +72 -0
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +72 -0
- label_studio_sdk/export_storage/s3/__init__.py +5 -0
- label_studio_sdk/export_storage/s3/client.py +1008 -0
- label_studio_sdk/export_storage/s3/types/__init__.py +6 -0
- label_studio_sdk/export_storage/s3/types/s3create_response.py +89 -0
- label_studio_sdk/export_storage/s3/types/s3update_response.py +89 -0
- label_studio_sdk/export_storage/types/__init__.py +5 -0
- label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +30 -0
- label_studio_sdk/files/__init__.py +2 -0
- label_studio_sdk/files/client.py +556 -0
- label_studio_sdk/import_storage/__init__.py +28 -0
- label_studio_sdk/import_storage/azure/__init__.py +5 -0
- label_studio_sdk/import_storage/azure/client.py +988 -0
- label_studio_sdk/import_storage/azure/types/__init__.py +6 -0
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +82 -0
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +82 -0
- label_studio_sdk/import_storage/client.py +107 -0
- label_studio_sdk/import_storage/gcs/__init__.py +5 -0
- label_studio_sdk/import_storage/gcs/client.py +988 -0
- label_studio_sdk/import_storage/gcs/types/__init__.py +6 -0
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +82 -0
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +82 -0
- label_studio_sdk/import_storage/local/__init__.py +5 -0
- label_studio_sdk/import_storage/local/client.py +836 -0
- label_studio_sdk/import_storage/local/types/__init__.py +6 -0
- label_studio_sdk/import_storage/local/types/local_create_response.py +57 -0
- label_studio_sdk/import_storage/local/types/local_update_response.py +57 -0
- label_studio_sdk/import_storage/redis/__init__.py +5 -0
- label_studio_sdk/import_storage/redis/client.py +924 -0
- label_studio_sdk/import_storage/redis/types/__init__.py +6 -0
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +72 -0
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +72 -0
- label_studio_sdk/import_storage/s3/__init__.py +5 -0
- label_studio_sdk/import_storage/s3/client.py +1138 -0
- label_studio_sdk/import_storage/s3/types/__init__.py +6 -0
- label_studio_sdk/import_storage/s3/types/s3create_response.py +109 -0
- label_studio_sdk/import_storage/s3/types/s3update_response.py +109 -0
- label_studio_sdk/import_storage/types/__init__.py +5 -0
- label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +30 -0
- label_studio_sdk/label_interface/base.py +10 -0
- label_studio_sdk/label_interface/control_tags.py +109 -71
- label_studio_sdk/label_interface/data_examples.json +96 -0
- label_studio_sdk/label_interface/interface.py +102 -53
- label_studio_sdk/label_interface/object_tags.py +8 -13
- label_studio_sdk/label_interface/region.py +33 -1
- label_studio_sdk/ml/__init__.py +19 -0
- label_studio_sdk/ml/client.py +981 -0
- label_studio_sdk/ml/types/__init__.py +17 -0
- label_studio_sdk/ml/types/ml_create_request_auth_method.py +5 -0
- label_studio_sdk/ml/types/ml_create_response.py +78 -0
- label_studio_sdk/ml/types/ml_create_response_auth_method.py +5 -0
- label_studio_sdk/ml/types/ml_update_request_auth_method.py +5 -0
- label_studio_sdk/ml/types/ml_update_response.py +78 -0
- label_studio_sdk/ml/types/ml_update_response_auth_method.py +5 -0
- label_studio_sdk/predictions/__init__.py +2 -0
- label_studio_sdk/predictions/client.py +638 -0
- label_studio_sdk/projects/__init__.py +6 -0
- label_studio_sdk/projects/client.py +1055 -0
- label_studio_sdk/projects/client_ext.py +19 -0
- label_studio_sdk/projects/exports/__init__.py +2 -0
- label_studio_sdk/projects/exports/client.py +930 -0
- label_studio_sdk/projects/types/__init__.py +7 -0
- label_studio_sdk/projects/types/projects_create_response.py +96 -0
- label_studio_sdk/projects/types/projects_import_tasks_response.py +71 -0
- label_studio_sdk/projects/types/projects_list_response.py +33 -0
- label_studio_sdk/py.typed +0 -0
- label_studio_sdk/tasks/__init__.py +5 -0
- label_studio_sdk/tasks/client.py +835 -0
- label_studio_sdk/tasks/client_ext.py +18 -0
- label_studio_sdk/tasks/types/__init__.py +6 -0
- label_studio_sdk/tasks/types/tasks_list_request_fields.py +5 -0
- label_studio_sdk/tasks/types/tasks_list_response.py +48 -0
- label_studio_sdk/types/__init__.py +115 -0
- label_studio_sdk/types/annotation.py +116 -0
- label_studio_sdk/types/annotation_filter_options.py +42 -0
- label_studio_sdk/types/annotation_last_action.py +19 -0
- label_studio_sdk/types/azure_blob_export_storage.py +112 -0
- label_studio_sdk/types/azure_blob_export_storage_status.py +7 -0
- label_studio_sdk/types/azure_blob_import_storage.py +113 -0
- label_studio_sdk/types/azure_blob_import_storage_status.py +7 -0
- label_studio_sdk/types/base_task.py +113 -0
- label_studio_sdk/types/base_user.py +42 -0
- label_studio_sdk/types/converted_format.py +36 -0
- label_studio_sdk/types/converted_format_status.py +5 -0
- label_studio_sdk/types/export.py +48 -0
- label_studio_sdk/types/export_convert.py +32 -0
- label_studio_sdk/types/export_create.py +54 -0
- label_studio_sdk/types/export_create_status.py +5 -0
- label_studio_sdk/types/export_status.py +5 -0
- label_studio_sdk/types/file_upload.py +30 -0
- label_studio_sdk/types/filter.py +53 -0
- label_studio_sdk/types/filter_group.py +35 -0
- label_studio_sdk/types/gcs_export_storage.py +112 -0
- label_studio_sdk/types/gcs_export_storage_status.py +7 -0
- label_studio_sdk/types/gcs_import_storage.py +113 -0
- label_studio_sdk/types/gcs_import_storage_status.py +7 -0
- label_studio_sdk/types/local_files_export_storage.py +97 -0
- label_studio_sdk/types/local_files_export_storage_status.py +7 -0
- label_studio_sdk/types/local_files_import_storage.py +92 -0
- label_studio_sdk/types/local_files_import_storage_status.py +7 -0
- label_studio_sdk/types/ml_backend.py +89 -0
- label_studio_sdk/types/ml_backend_auth_method.py +5 -0
- label_studio_sdk/types/ml_backend_state.py +5 -0
- label_studio_sdk/types/prediction.py +78 -0
- label_studio_sdk/types/project.py +198 -0
- label_studio_sdk/types/project_import.py +63 -0
- label_studio_sdk/types/project_import_status.py +5 -0
- label_studio_sdk/types/project_label_config.py +32 -0
- label_studio_sdk/types/project_sampling.py +7 -0
- label_studio_sdk/types/project_skip_queue.py +5 -0
- label_studio_sdk/types/redis_export_storage.py +117 -0
- label_studio_sdk/types/redis_export_storage_status.py +7 -0
- label_studio_sdk/types/redis_import_storage.py +112 -0
- label_studio_sdk/types/redis_import_storage_status.py +7 -0
- label_studio_sdk/types/s3export_storage.py +134 -0
- label_studio_sdk/types/s3export_storage_status.py +7 -0
- label_studio_sdk/types/s3import_storage.py +140 -0
- label_studio_sdk/types/s3import_storage_status.py +7 -0
- label_studio_sdk/types/serialization_option.py +36 -0
- label_studio_sdk/types/serialization_options.py +45 -0
- label_studio_sdk/types/task.py +157 -0
- label_studio_sdk/types/task_filter_options.py +49 -0
- label_studio_sdk/types/user_simple.py +37 -0
- label_studio_sdk/types/view.py +55 -0
- label_studio_sdk/types/webhook.py +67 -0
- label_studio_sdk/types/webhook_actions_item.py +21 -0
- label_studio_sdk/types/webhook_serializer_for_update.py +67 -0
- label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +21 -0
- label_studio_sdk/users/__init__.py +5 -0
- label_studio_sdk/users/client.py +830 -0
- label_studio_sdk/users/types/__init__.py +6 -0
- label_studio_sdk/users/types/users_get_token_response.py +36 -0
- label_studio_sdk/users/types/users_reset_token_response.py +36 -0
- label_studio_sdk/version.py +4 -0
- label_studio_sdk/views/__init__.py +35 -0
- label_studio_sdk/views/client.py +564 -0
- label_studio_sdk/views/types/__init__.py +33 -0
- label_studio_sdk/views/types/views_create_request_data.py +43 -0
- label_studio_sdk/views/types/views_create_request_data_filters.py +43 -0
- label_studio_sdk/views/types/views_create_request_data_filters_conjunction.py +5 -0
- label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +49 -0
- 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 +31 -0
- label_studio_sdk/views/types/views_update_request_data.py +43 -0
- label_studio_sdk/views/types/views_update_request_data_filters.py +43 -0
- label_studio_sdk/views/types/views_update_request_data_filters_conjunction.py +5 -0
- label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +49 -0
- 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 +31 -0
- label_studio_sdk/webhooks/__init__.py +5 -0
- label_studio_sdk/webhooks/client.py +636 -0
- label_studio_sdk/webhooks/types/__init__.py +5 -0
- label_studio_sdk/webhooks/types/webhooks_update_request_actions_item.py +21 -0
- label_studio_sdk-1.0.1.dist-info/METADATA +163 -0
- label_studio_sdk-1.0.1.dist-info/RECORD +256 -0
- {label_studio_sdk-0.0.34.dist-info → label_studio_sdk-1.0.1.dist-info}/WHEEL +1 -2
- label_studio_sdk/objects.py +0 -35
- label_studio_sdk-0.0.34.dist-info/LICENSE +0 -201
- label_studio_sdk-0.0.34.dist-info/METADATA +0 -24
- label_studio_sdk-0.0.34.dist-info/RECORD +0 -37
- label_studio_sdk-0.0.34.dist-info/top_level.txt +0 -2
- tests/test_client.py +0 -37
- tests/test_export.py +0 -105
- tests/test_interface/__init__.py +0 -1
- tests/test_interface/configs.py +0 -137
- tests/test_interface/mockups.py +0 -22
- tests/test_interface/test_compat.py +0 -64
- tests/test_interface/test_control_tags.py +0 -55
- tests/test_interface/test_data_generation.py +0 -45
- tests/test_interface/test_lpi.py +0 -15
- tests/test_interface/test_main.py +0 -196
- tests/test_interface/test_object_tags.py +0 -36
- tests/test_interface/test_region.py +0 -36
- tests/test_interface/test_validate_summary.py +0 -35
- tests/test_interface/test_validation.py +0 -59
- {tests → label_studio_sdk/_extensions}/__init__.py +0 -0
- /label_studio_sdk/{exceptions.py → _legacy/exceptions.py} +0 -0
- /label_studio_sdk/{users.py → _legacy/users.py} +0 -0
- /label_studio_sdk/{utils.py → _legacy/utils.py} +0 -0
- /label_studio_sdk/{workspaces.py → _legacy/workspaces.py} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ....core.datetime_utils import serialize_datetime
|
|
7
|
+
from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AzureCreateResponse(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
|
+
presign: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Presign URLs for direct download
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
presign_ttl: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
Presign TTL in minutes
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
title: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
32
|
+
"""
|
|
33
|
+
Storage title
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
description: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
37
|
+
"""
|
|
38
|
+
Storage description
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
project: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
Project ID
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
container: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
47
|
+
"""
|
|
48
|
+
Azure blob container
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
52
|
+
"""
|
|
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
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
67
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
68
|
+
return super().json(**kwargs_with_defaults)
|
|
69
|
+
|
|
70
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
71
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
72
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
73
|
+
|
|
74
|
+
return deep_union_pydantic_dicts(
|
|
75
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
class Config:
|
|
79
|
+
frozen = True
|
|
80
|
+
smart_union = True
|
|
81
|
+
extra = pydantic_v1.Extra.allow
|
|
82
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ....core.datetime_utils import serialize_datetime
|
|
7
|
+
from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AzureUpdateResponse(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
|
+
presign: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Presign URLs for direct download
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
presign_ttl: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
Presign TTL in minutes
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
title: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
32
|
+
"""
|
|
33
|
+
Storage title
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
description: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
37
|
+
"""
|
|
38
|
+
Storage description
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
project: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
Project ID
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
container: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
47
|
+
"""
|
|
48
|
+
Azure blob container
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
52
|
+
"""
|
|
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
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
67
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
68
|
+
return super().json(**kwargs_with_defaults)
|
|
69
|
+
|
|
70
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
71
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
72
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
73
|
+
|
|
74
|
+
return deep_union_pydantic_dicts(
|
|
75
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
class Config:
|
|
79
|
+
frozen = True
|
|
80
|
+
smart_union = True
|
|
81
|
+
extra = pydantic_v1.Extra.allow
|
|
82
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.pydantic_utilities import pydantic_v1
|
|
9
|
+
from ..core.request_options import RequestOptions
|
|
10
|
+
from .azure.client import AsyncAzureClient, AzureClient
|
|
11
|
+
from .gcs.client import AsyncGcsClient, GcsClient
|
|
12
|
+
from .local.client import AsyncLocalClient, LocalClient
|
|
13
|
+
from .redis.client import AsyncRedisClient, RedisClient
|
|
14
|
+
from .s3.client import AsyncS3Client, S3Client
|
|
15
|
+
from .types.import_storage_list_types_response_item import ImportStorageListTypesResponseItem
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ImportStorageClient:
|
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
20
|
+
self._client_wrapper = client_wrapper
|
|
21
|
+
self.azure = AzureClient(client_wrapper=self._client_wrapper)
|
|
22
|
+
self.gcs = GcsClient(client_wrapper=self._client_wrapper)
|
|
23
|
+
self.local = LocalClient(client_wrapper=self._client_wrapper)
|
|
24
|
+
self.redis = RedisClient(client_wrapper=self._client_wrapper)
|
|
25
|
+
self.s3 = S3Client(client_wrapper=self._client_wrapper)
|
|
26
|
+
|
|
27
|
+
def list_types(
|
|
28
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
29
|
+
) -> typing.List[ImportStorageListTypesResponseItem]:
|
|
30
|
+
"""
|
|
31
|
+
Retrieve a list of the import storages types.
|
|
32
|
+
|
|
33
|
+
Parameters
|
|
34
|
+
----------
|
|
35
|
+
request_options : typing.Optional[RequestOptions]
|
|
36
|
+
Request-specific configuration.
|
|
37
|
+
|
|
38
|
+
Returns
|
|
39
|
+
-------
|
|
40
|
+
typing.List[ImportStorageListTypesResponseItem]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Examples
|
|
44
|
+
--------
|
|
45
|
+
from label_studio_sdk.client import LabelStudio
|
|
46
|
+
|
|
47
|
+
client = LabelStudio(
|
|
48
|
+
api_key="YOUR_API_KEY",
|
|
49
|
+
)
|
|
50
|
+
client.import_storage.list_types()
|
|
51
|
+
"""
|
|
52
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
53
|
+
"api/storages/types", method="GET", request_options=request_options
|
|
54
|
+
)
|
|
55
|
+
if 200 <= _response.status_code < 300:
|
|
56
|
+
return pydantic_v1.parse_obj_as(typing.List[ImportStorageListTypesResponseItem], _response.json()) # type: ignore
|
|
57
|
+
try:
|
|
58
|
+
_response_json = _response.json()
|
|
59
|
+
except JSONDecodeError:
|
|
60
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
61
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class AsyncImportStorageClient:
|
|
65
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
66
|
+
self._client_wrapper = client_wrapper
|
|
67
|
+
self.azure = AsyncAzureClient(client_wrapper=self._client_wrapper)
|
|
68
|
+
self.gcs = AsyncGcsClient(client_wrapper=self._client_wrapper)
|
|
69
|
+
self.local = AsyncLocalClient(client_wrapper=self._client_wrapper)
|
|
70
|
+
self.redis = AsyncRedisClient(client_wrapper=self._client_wrapper)
|
|
71
|
+
self.s3 = AsyncS3Client(client_wrapper=self._client_wrapper)
|
|
72
|
+
|
|
73
|
+
async def list_types(
|
|
74
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
75
|
+
) -> typing.List[ImportStorageListTypesResponseItem]:
|
|
76
|
+
"""
|
|
77
|
+
Retrieve a list of the import storages types.
|
|
78
|
+
|
|
79
|
+
Parameters
|
|
80
|
+
----------
|
|
81
|
+
request_options : typing.Optional[RequestOptions]
|
|
82
|
+
Request-specific configuration.
|
|
83
|
+
|
|
84
|
+
Returns
|
|
85
|
+
-------
|
|
86
|
+
typing.List[ImportStorageListTypesResponseItem]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
Examples
|
|
90
|
+
--------
|
|
91
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
92
|
+
|
|
93
|
+
client = AsyncLabelStudio(
|
|
94
|
+
api_key="YOUR_API_KEY",
|
|
95
|
+
)
|
|
96
|
+
await client.import_storage.list_types()
|
|
97
|
+
"""
|
|
98
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
99
|
+
"api/storages/types", method="GET", request_options=request_options
|
|
100
|
+
)
|
|
101
|
+
if 200 <= _response.status_code < 300:
|
|
102
|
+
return pydantic_v1.parse_obj_as(typing.List[ImportStorageListTypesResponseItem], _response.json()) # type: ignore
|
|
103
|
+
try:
|
|
104
|
+
_response_json = _response.json()
|
|
105
|
+
except JSONDecodeError:
|
|
106
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
107
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|