label-studio-sdk 0.0.32__py3-none-any.whl → 1.0.0__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 +206 -6
- 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/_legacy/__init__.py +11 -0
- label_studio_sdk/_legacy/client.py +471 -0
- label_studio_sdk/_legacy/exceptions.py +10 -0
- label_studio_sdk/_legacy/label_interface/__init__.py +1 -0
- label_studio_sdk/_legacy/label_interface/base.py +77 -0
- label_studio_sdk/_legacy/label_interface/control_tags.py +756 -0
- label_studio_sdk/_legacy/label_interface/data_examples.json +96 -0
- label_studio_sdk/_legacy/label_interface/interface.py +925 -0
- label_studio_sdk/_legacy/label_interface/label_tags.py +72 -0
- label_studio_sdk/_legacy/label_interface/object_tags.py +292 -0
- label_studio_sdk/_legacy/label_interface/region.py +43 -0
- label_studio_sdk/_legacy/objects.py +35 -0
- label_studio_sdk/{project.py → _legacy/project.py} +711 -258
- label_studio_sdk/_legacy/schema/label_config_schema.json +226 -0
- label_studio_sdk/{users.py → _legacy/users.py} +15 -13
- label_studio_sdk/{utils.py → _legacy/utils.py} +31 -30
- label_studio_sdk/{workspaces.py → _legacy/workspaces.py} +13 -11
- label_studio_sdk/actions/__init__.py +2 -0
- label_studio_sdk/actions/client.py +150 -0
- label_studio_sdk/annotations/__init__.py +2 -0
- label_studio_sdk/annotations/client.py +750 -0
- label_studio_sdk/client.py +164 -436
- 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 +443 -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/data_manager.py +32 -23
- 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 +722 -0
- label_studio_sdk/export_storage/azure/types/__init__.py +6 -0
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +52 -0
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +52 -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 +722 -0
- label_studio_sdk/export_storage/gcs/types/__init__.py +6 -0
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +52 -0
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +52 -0
- label_studio_sdk/export_storage/local/__init__.py +5 -0
- label_studio_sdk/export_storage/local/client.py +688 -0
- label_studio_sdk/export_storage/local/types/__init__.py +6 -0
- label_studio_sdk/export_storage/local/types/local_create_response.py +47 -0
- label_studio_sdk/export_storage/local/types/local_update_response.py +47 -0
- label_studio_sdk/export_storage/redis/__init__.py +5 -0
- label_studio_sdk/export_storage/redis/client.py +714 -0
- label_studio_sdk/export_storage/redis/types/__init__.py +6 -0
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +57 -0
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +57 -0
- label_studio_sdk/export_storage/s3/__init__.py +5 -0
- label_studio_sdk/export_storage/s3/client.py +820 -0
- label_studio_sdk/export_storage/s3/types/__init__.py +6 -0
- label_studio_sdk/export_storage/s3/types/s3create_response.py +74 -0
- label_studio_sdk/export_storage/s3/types/s3update_response.py +74 -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 +812 -0
- label_studio_sdk/import_storage/azure/types/__init__.py +6 -0
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +72 -0
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +72 -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 +812 -0
- label_studio_sdk/import_storage/gcs/types/__init__.py +6 -0
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +72 -0
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +72 -0
- label_studio_sdk/import_storage/local/__init__.py +5 -0
- label_studio_sdk/import_storage/local/client.py +690 -0
- label_studio_sdk/import_storage/local/types/__init__.py +6 -0
- label_studio_sdk/import_storage/local/types/local_create_response.py +47 -0
- label_studio_sdk/import_storage/local/types/local_update_response.py +47 -0
- label_studio_sdk/import_storage/redis/__init__.py +5 -0
- label_studio_sdk/import_storage/redis/client.py +768 -0
- label_studio_sdk/import_storage/redis/types/__init__.py +6 -0
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +62 -0
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +62 -0
- label_studio_sdk/import_storage/s3/__init__.py +5 -0
- label_studio_sdk/import_storage/s3/client.py +912 -0
- label_studio_sdk/import_storage/s3/types/__init__.py +6 -0
- label_studio_sdk/import_storage/s3/types/s3create_response.py +99 -0
- label_studio_sdk/import_storage/s3/types/s3update_response.py +99 -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/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 +1053 -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 +811 -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 +31 -0
- label_studio_sdk/views/client.py +564 -0
- label_studio_sdk/views/types/__init__.py +29 -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 +47 -0
- label_studio_sdk/views/types/views_create_request_data_ordering_item.py +38 -0
- label_studio_sdk/views/types/views_create_request_data_ordering_item_direction.py +5 -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 +47 -0
- label_studio_sdk/views/types/views_update_request_data_ordering_item.py +38 -0
- label_studio_sdk/views/types/views_update_request_data_ordering_item_direction.py +5 -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.0.dist-info/METADATA +307 -0
- label_studio_sdk-1.0.0.dist-info/RECORD +239 -0
- {label_studio_sdk-0.0.32.dist-info → label_studio_sdk-1.0.0.dist-info}/WHEEL +1 -2
- docs/__init__.py +0 -3
- label_studio_sdk-0.0.32.dist-info/LICENSE +0 -201
- label_studio_sdk-0.0.32.dist-info/METADATA +0 -22
- label_studio_sdk-0.0.32.dist-info/RECORD +0 -15
- label_studio_sdk-0.0.32.dist-info/top_level.txt +0 -3
- tests/test_client.py +0 -26
- {tests → label_studio_sdk/_extensions}/__init__.py +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
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 UsersGetTokenResponse(pydantic_v1.BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
User token
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
detail: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
Token
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
21
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
22
|
+
return super().json(**kwargs_with_defaults)
|
|
23
|
+
|
|
24
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
25
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
26
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
27
|
+
|
|
28
|
+
return deep_union_pydantic_dicts(
|
|
29
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
frozen = True
|
|
34
|
+
smart_union = True
|
|
35
|
+
extra = pydantic_v1.Extra.allow
|
|
36
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 UsersResetTokenResponse(pydantic_v1.BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
User token
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
token: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
Token
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
21
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
22
|
+
return super().json(**kwargs_with_defaults)
|
|
23
|
+
|
|
24
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
25
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
26
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
27
|
+
|
|
28
|
+
return deep_union_pydantic_dicts(
|
|
29
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
frozen = True
|
|
34
|
+
smart_union = True
|
|
35
|
+
extra = pydantic_v1.Extra.allow
|
|
36
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .types import (
|
|
4
|
+
ViewsCreateRequestData,
|
|
5
|
+
ViewsCreateRequestDataFilters,
|
|
6
|
+
ViewsCreateRequestDataFiltersConjunction,
|
|
7
|
+
ViewsCreateRequestDataFiltersItemsItem,
|
|
8
|
+
ViewsCreateRequestDataOrderingItem,
|
|
9
|
+
ViewsCreateRequestDataOrderingItemDirection,
|
|
10
|
+
ViewsUpdateRequestData,
|
|
11
|
+
ViewsUpdateRequestDataFilters,
|
|
12
|
+
ViewsUpdateRequestDataFiltersConjunction,
|
|
13
|
+
ViewsUpdateRequestDataFiltersItemsItem,
|
|
14
|
+
ViewsUpdateRequestDataOrderingItem,
|
|
15
|
+
ViewsUpdateRequestDataOrderingItemDirection,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"ViewsCreateRequestData",
|
|
20
|
+
"ViewsCreateRequestDataFilters",
|
|
21
|
+
"ViewsCreateRequestDataFiltersConjunction",
|
|
22
|
+
"ViewsCreateRequestDataFiltersItemsItem",
|
|
23
|
+
"ViewsCreateRequestDataOrderingItem",
|
|
24
|
+
"ViewsCreateRequestDataOrderingItemDirection",
|
|
25
|
+
"ViewsUpdateRequestData",
|
|
26
|
+
"ViewsUpdateRequestDataFilters",
|
|
27
|
+
"ViewsUpdateRequestDataFiltersConjunction",
|
|
28
|
+
"ViewsUpdateRequestDataFiltersItemsItem",
|
|
29
|
+
"ViewsUpdateRequestDataOrderingItem",
|
|
30
|
+
"ViewsUpdateRequestDataOrderingItemDirection",
|
|
31
|
+
]
|
|
@@ -0,0 +1,564 @@
|
|
|
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.jsonable_encoder import jsonable_encoder
|
|
9
|
+
from ..core.pydantic_utilities import pydantic_v1
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..types.view import View
|
|
12
|
+
from .types.views_create_request_data import ViewsCreateRequestData
|
|
13
|
+
from .types.views_update_request_data import ViewsUpdateRequestData
|
|
14
|
+
|
|
15
|
+
# this is used as the default value for optional parameters
|
|
16
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ViewsClient:
|
|
20
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
|
+
self._client_wrapper = client_wrapper
|
|
22
|
+
|
|
23
|
+
def list(
|
|
24
|
+
self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
25
|
+
) -> typing.List[View]:
|
|
26
|
+
"""
|
|
27
|
+
List all views for a specific project. A view is a tab in the Data Manager where you can set filters and customize which tasks and information appears.
|
|
28
|
+
|
|
29
|
+
You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use [List all projects](../projects/list).
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
project : typing.Optional[int]
|
|
34
|
+
Project ID
|
|
35
|
+
|
|
36
|
+
request_options : typing.Optional[RequestOptions]
|
|
37
|
+
Request-specific configuration.
|
|
38
|
+
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
|
+
typing.List[View]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
Examples
|
|
45
|
+
--------
|
|
46
|
+
from label_studio_sdk.client import LabelStudio
|
|
47
|
+
|
|
48
|
+
client = LabelStudio(
|
|
49
|
+
api_key="YOUR_API_KEY",
|
|
50
|
+
)
|
|
51
|
+
client.views.list()
|
|
52
|
+
"""
|
|
53
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
54
|
+
"api/dm/views/", method="GET", params={"project": project}, request_options=request_options
|
|
55
|
+
)
|
|
56
|
+
if 200 <= _response.status_code < 300:
|
|
57
|
+
return pydantic_v1.parse_obj_as(typing.List[View], _response.json()) # type: ignore
|
|
58
|
+
try:
|
|
59
|
+
_response_json = _response.json()
|
|
60
|
+
except JSONDecodeError:
|
|
61
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
62
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
63
|
+
|
|
64
|
+
def create(
|
|
65
|
+
self,
|
|
66
|
+
*,
|
|
67
|
+
data: typing.Optional[ViewsCreateRequestData] = OMIT,
|
|
68
|
+
project: typing.Optional[int] = OMIT,
|
|
69
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
70
|
+
) -> View:
|
|
71
|
+
"""
|
|
72
|
+
Create a new Data Manager view for a specific project. A view is a tab in the Data Manager where you can set filters and customize what tasks and information appears.
|
|
73
|
+
|
|
74
|
+
You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use [List all projects](../projects/list).
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
data : typing.Optional[ViewsCreateRequestData]
|
|
79
|
+
Custom view data
|
|
80
|
+
|
|
81
|
+
project : typing.Optional[int]
|
|
82
|
+
Project ID
|
|
83
|
+
|
|
84
|
+
request_options : typing.Optional[RequestOptions]
|
|
85
|
+
Request-specific configuration.
|
|
86
|
+
|
|
87
|
+
Returns
|
|
88
|
+
-------
|
|
89
|
+
View
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
Examples
|
|
93
|
+
--------
|
|
94
|
+
from label_studio_sdk.client import LabelStudio
|
|
95
|
+
|
|
96
|
+
client = LabelStudio(
|
|
97
|
+
api_key="YOUR_API_KEY",
|
|
98
|
+
)
|
|
99
|
+
client.views.create()
|
|
100
|
+
"""
|
|
101
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
102
|
+
"api/dm/views/",
|
|
103
|
+
method="POST",
|
|
104
|
+
json={"data": data, "project": project},
|
|
105
|
+
request_options=request_options,
|
|
106
|
+
omit=OMIT,
|
|
107
|
+
)
|
|
108
|
+
if 200 <= _response.status_code < 300:
|
|
109
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
110
|
+
try:
|
|
111
|
+
_response_json = _response.json()
|
|
112
|
+
except JSONDecodeError:
|
|
113
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
114
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
115
|
+
|
|
116
|
+
def delete_all(self, *, project: int, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
117
|
+
"""
|
|
118
|
+
Delete all views for a specific project. A view is a tab in the Data Manager where you can set filters and customize what tasks appear.
|
|
119
|
+
|
|
120
|
+
You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use [List all projects](../projects/list).
|
|
121
|
+
|
|
122
|
+
Parameters
|
|
123
|
+
----------
|
|
124
|
+
project : int
|
|
125
|
+
|
|
126
|
+
request_options : typing.Optional[RequestOptions]
|
|
127
|
+
Request-specific configuration.
|
|
128
|
+
|
|
129
|
+
Returns
|
|
130
|
+
-------
|
|
131
|
+
None
|
|
132
|
+
|
|
133
|
+
Examples
|
|
134
|
+
--------
|
|
135
|
+
from label_studio_sdk.client import LabelStudio
|
|
136
|
+
|
|
137
|
+
client = LabelStudio(
|
|
138
|
+
api_key="YOUR_API_KEY",
|
|
139
|
+
)
|
|
140
|
+
client.views.delete_all(
|
|
141
|
+
project=1,
|
|
142
|
+
)
|
|
143
|
+
"""
|
|
144
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
145
|
+
"api/dm/views/reset/",
|
|
146
|
+
method="DELETE",
|
|
147
|
+
json={"project": project},
|
|
148
|
+
request_options=request_options,
|
|
149
|
+
omit=OMIT,
|
|
150
|
+
)
|
|
151
|
+
if 200 <= _response.status_code < 300:
|
|
152
|
+
return
|
|
153
|
+
try:
|
|
154
|
+
_response_json = _response.json()
|
|
155
|
+
except JSONDecodeError:
|
|
156
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
157
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
158
|
+
|
|
159
|
+
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> View:
|
|
160
|
+
"""
|
|
161
|
+
Get the details about a specific Data Manager view (tab). You will need to supply the view ID. You can find this using [List views](list).
|
|
162
|
+
|
|
163
|
+
Parameters
|
|
164
|
+
----------
|
|
165
|
+
id : str
|
|
166
|
+
View ID
|
|
167
|
+
|
|
168
|
+
request_options : typing.Optional[RequestOptions]
|
|
169
|
+
Request-specific configuration.
|
|
170
|
+
|
|
171
|
+
Returns
|
|
172
|
+
-------
|
|
173
|
+
View
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
Examples
|
|
177
|
+
--------
|
|
178
|
+
from label_studio_sdk.client import LabelStudio
|
|
179
|
+
|
|
180
|
+
client = LabelStudio(
|
|
181
|
+
api_key="YOUR_API_KEY",
|
|
182
|
+
)
|
|
183
|
+
client.views.get(
|
|
184
|
+
id="id",
|
|
185
|
+
)
|
|
186
|
+
"""
|
|
187
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
188
|
+
f"api/dm/views/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
189
|
+
)
|
|
190
|
+
if 200 <= _response.status_code < 300:
|
|
191
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
192
|
+
try:
|
|
193
|
+
_response_json = _response.json()
|
|
194
|
+
except JSONDecodeError:
|
|
195
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
196
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
197
|
+
|
|
198
|
+
def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
199
|
+
"""
|
|
200
|
+
Delete a specific Data Manager view (tab) by ID. You can find the view using [List views](list).
|
|
201
|
+
|
|
202
|
+
Parameters
|
|
203
|
+
----------
|
|
204
|
+
id : str
|
|
205
|
+
View ID
|
|
206
|
+
|
|
207
|
+
request_options : typing.Optional[RequestOptions]
|
|
208
|
+
Request-specific configuration.
|
|
209
|
+
|
|
210
|
+
Returns
|
|
211
|
+
-------
|
|
212
|
+
None
|
|
213
|
+
|
|
214
|
+
Examples
|
|
215
|
+
--------
|
|
216
|
+
from label_studio_sdk.client import LabelStudio
|
|
217
|
+
|
|
218
|
+
client = LabelStudio(
|
|
219
|
+
api_key="YOUR_API_KEY",
|
|
220
|
+
)
|
|
221
|
+
client.views.delete(
|
|
222
|
+
id="id",
|
|
223
|
+
)
|
|
224
|
+
"""
|
|
225
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
226
|
+
f"api/dm/views/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
227
|
+
)
|
|
228
|
+
if 200 <= _response.status_code < 300:
|
|
229
|
+
return
|
|
230
|
+
try:
|
|
231
|
+
_response_json = _response.json()
|
|
232
|
+
except JSONDecodeError:
|
|
233
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
234
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
235
|
+
|
|
236
|
+
def update(
|
|
237
|
+
self,
|
|
238
|
+
id: str,
|
|
239
|
+
*,
|
|
240
|
+
data: typing.Optional[ViewsUpdateRequestData] = OMIT,
|
|
241
|
+
project: typing.Optional[int] = OMIT,
|
|
242
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
243
|
+
) -> View:
|
|
244
|
+
"""
|
|
245
|
+
You can update a specific Data Manager view (tab) with additional filters and other customizations. You will need to supply the view ID. You can find this using [List views](list).
|
|
246
|
+
|
|
247
|
+
Parameters
|
|
248
|
+
----------
|
|
249
|
+
id : str
|
|
250
|
+
View ID
|
|
251
|
+
|
|
252
|
+
data : typing.Optional[ViewsUpdateRequestData]
|
|
253
|
+
Custom view data
|
|
254
|
+
|
|
255
|
+
project : typing.Optional[int]
|
|
256
|
+
Project ID
|
|
257
|
+
|
|
258
|
+
request_options : typing.Optional[RequestOptions]
|
|
259
|
+
Request-specific configuration.
|
|
260
|
+
|
|
261
|
+
Returns
|
|
262
|
+
-------
|
|
263
|
+
View
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
Examples
|
|
267
|
+
--------
|
|
268
|
+
from label_studio_sdk.client import LabelStudio
|
|
269
|
+
|
|
270
|
+
client = LabelStudio(
|
|
271
|
+
api_key="YOUR_API_KEY",
|
|
272
|
+
)
|
|
273
|
+
client.views.update(
|
|
274
|
+
id="id",
|
|
275
|
+
)
|
|
276
|
+
"""
|
|
277
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
278
|
+
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
279
|
+
method="PATCH",
|
|
280
|
+
json={"data": data, "project": project},
|
|
281
|
+
request_options=request_options,
|
|
282
|
+
omit=OMIT,
|
|
283
|
+
)
|
|
284
|
+
if 200 <= _response.status_code < 300:
|
|
285
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
286
|
+
try:
|
|
287
|
+
_response_json = _response.json()
|
|
288
|
+
except JSONDecodeError:
|
|
289
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
290
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
class AsyncViewsClient:
|
|
294
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
295
|
+
self._client_wrapper = client_wrapper
|
|
296
|
+
|
|
297
|
+
async def list(
|
|
298
|
+
self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
299
|
+
) -> typing.List[View]:
|
|
300
|
+
"""
|
|
301
|
+
List all views for a specific project. A view is a tab in the Data Manager where you can set filters and customize which tasks and information appears.
|
|
302
|
+
|
|
303
|
+
You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use [List all projects](../projects/list).
|
|
304
|
+
|
|
305
|
+
Parameters
|
|
306
|
+
----------
|
|
307
|
+
project : typing.Optional[int]
|
|
308
|
+
Project ID
|
|
309
|
+
|
|
310
|
+
request_options : typing.Optional[RequestOptions]
|
|
311
|
+
Request-specific configuration.
|
|
312
|
+
|
|
313
|
+
Returns
|
|
314
|
+
-------
|
|
315
|
+
typing.List[View]
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
Examples
|
|
319
|
+
--------
|
|
320
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
321
|
+
|
|
322
|
+
client = AsyncLabelStudio(
|
|
323
|
+
api_key="YOUR_API_KEY",
|
|
324
|
+
)
|
|
325
|
+
await client.views.list()
|
|
326
|
+
"""
|
|
327
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
328
|
+
"api/dm/views/", method="GET", params={"project": project}, request_options=request_options
|
|
329
|
+
)
|
|
330
|
+
if 200 <= _response.status_code < 300:
|
|
331
|
+
return pydantic_v1.parse_obj_as(typing.List[View], _response.json()) # type: ignore
|
|
332
|
+
try:
|
|
333
|
+
_response_json = _response.json()
|
|
334
|
+
except JSONDecodeError:
|
|
335
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
336
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
337
|
+
|
|
338
|
+
async def create(
|
|
339
|
+
self,
|
|
340
|
+
*,
|
|
341
|
+
data: typing.Optional[ViewsCreateRequestData] = OMIT,
|
|
342
|
+
project: typing.Optional[int] = OMIT,
|
|
343
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
344
|
+
) -> View:
|
|
345
|
+
"""
|
|
346
|
+
Create a new Data Manager view for a specific project. A view is a tab in the Data Manager where you can set filters and customize what tasks and information appears.
|
|
347
|
+
|
|
348
|
+
You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use [List all projects](../projects/list).
|
|
349
|
+
|
|
350
|
+
Parameters
|
|
351
|
+
----------
|
|
352
|
+
data : typing.Optional[ViewsCreateRequestData]
|
|
353
|
+
Custom view data
|
|
354
|
+
|
|
355
|
+
project : typing.Optional[int]
|
|
356
|
+
Project ID
|
|
357
|
+
|
|
358
|
+
request_options : typing.Optional[RequestOptions]
|
|
359
|
+
Request-specific configuration.
|
|
360
|
+
|
|
361
|
+
Returns
|
|
362
|
+
-------
|
|
363
|
+
View
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
Examples
|
|
367
|
+
--------
|
|
368
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
369
|
+
|
|
370
|
+
client = AsyncLabelStudio(
|
|
371
|
+
api_key="YOUR_API_KEY",
|
|
372
|
+
)
|
|
373
|
+
await client.views.create()
|
|
374
|
+
"""
|
|
375
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
376
|
+
"api/dm/views/",
|
|
377
|
+
method="POST",
|
|
378
|
+
json={"data": data, "project": project},
|
|
379
|
+
request_options=request_options,
|
|
380
|
+
omit=OMIT,
|
|
381
|
+
)
|
|
382
|
+
if 200 <= _response.status_code < 300:
|
|
383
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
384
|
+
try:
|
|
385
|
+
_response_json = _response.json()
|
|
386
|
+
except JSONDecodeError:
|
|
387
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
388
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
389
|
+
|
|
390
|
+
async def delete_all(self, *, project: int, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
391
|
+
"""
|
|
392
|
+
Delete all views for a specific project. A view is a tab in the Data Manager where you can set filters and customize what tasks appear.
|
|
393
|
+
|
|
394
|
+
You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use [List all projects](../projects/list).
|
|
395
|
+
|
|
396
|
+
Parameters
|
|
397
|
+
----------
|
|
398
|
+
project : int
|
|
399
|
+
|
|
400
|
+
request_options : typing.Optional[RequestOptions]
|
|
401
|
+
Request-specific configuration.
|
|
402
|
+
|
|
403
|
+
Returns
|
|
404
|
+
-------
|
|
405
|
+
None
|
|
406
|
+
|
|
407
|
+
Examples
|
|
408
|
+
--------
|
|
409
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
410
|
+
|
|
411
|
+
client = AsyncLabelStudio(
|
|
412
|
+
api_key="YOUR_API_KEY",
|
|
413
|
+
)
|
|
414
|
+
await client.views.delete_all(
|
|
415
|
+
project=1,
|
|
416
|
+
)
|
|
417
|
+
"""
|
|
418
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
419
|
+
"api/dm/views/reset/",
|
|
420
|
+
method="DELETE",
|
|
421
|
+
json={"project": project},
|
|
422
|
+
request_options=request_options,
|
|
423
|
+
omit=OMIT,
|
|
424
|
+
)
|
|
425
|
+
if 200 <= _response.status_code < 300:
|
|
426
|
+
return
|
|
427
|
+
try:
|
|
428
|
+
_response_json = _response.json()
|
|
429
|
+
except JSONDecodeError:
|
|
430
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
431
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
432
|
+
|
|
433
|
+
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> View:
|
|
434
|
+
"""
|
|
435
|
+
Get the details about a specific Data Manager view (tab). You will need to supply the view ID. You can find this using [List views](list).
|
|
436
|
+
|
|
437
|
+
Parameters
|
|
438
|
+
----------
|
|
439
|
+
id : str
|
|
440
|
+
View ID
|
|
441
|
+
|
|
442
|
+
request_options : typing.Optional[RequestOptions]
|
|
443
|
+
Request-specific configuration.
|
|
444
|
+
|
|
445
|
+
Returns
|
|
446
|
+
-------
|
|
447
|
+
View
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
Examples
|
|
451
|
+
--------
|
|
452
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
453
|
+
|
|
454
|
+
client = AsyncLabelStudio(
|
|
455
|
+
api_key="YOUR_API_KEY",
|
|
456
|
+
)
|
|
457
|
+
await client.views.get(
|
|
458
|
+
id="id",
|
|
459
|
+
)
|
|
460
|
+
"""
|
|
461
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
462
|
+
f"api/dm/views/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
463
|
+
)
|
|
464
|
+
if 200 <= _response.status_code < 300:
|
|
465
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
466
|
+
try:
|
|
467
|
+
_response_json = _response.json()
|
|
468
|
+
except JSONDecodeError:
|
|
469
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
470
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
471
|
+
|
|
472
|
+
async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
473
|
+
"""
|
|
474
|
+
Delete a specific Data Manager view (tab) by ID. You can find the view using [List views](list).
|
|
475
|
+
|
|
476
|
+
Parameters
|
|
477
|
+
----------
|
|
478
|
+
id : str
|
|
479
|
+
View ID
|
|
480
|
+
|
|
481
|
+
request_options : typing.Optional[RequestOptions]
|
|
482
|
+
Request-specific configuration.
|
|
483
|
+
|
|
484
|
+
Returns
|
|
485
|
+
-------
|
|
486
|
+
None
|
|
487
|
+
|
|
488
|
+
Examples
|
|
489
|
+
--------
|
|
490
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
491
|
+
|
|
492
|
+
client = AsyncLabelStudio(
|
|
493
|
+
api_key="YOUR_API_KEY",
|
|
494
|
+
)
|
|
495
|
+
await client.views.delete(
|
|
496
|
+
id="id",
|
|
497
|
+
)
|
|
498
|
+
"""
|
|
499
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
500
|
+
f"api/dm/views/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
501
|
+
)
|
|
502
|
+
if 200 <= _response.status_code < 300:
|
|
503
|
+
return
|
|
504
|
+
try:
|
|
505
|
+
_response_json = _response.json()
|
|
506
|
+
except JSONDecodeError:
|
|
507
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
508
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
509
|
+
|
|
510
|
+
async def update(
|
|
511
|
+
self,
|
|
512
|
+
id: str,
|
|
513
|
+
*,
|
|
514
|
+
data: typing.Optional[ViewsUpdateRequestData] = OMIT,
|
|
515
|
+
project: typing.Optional[int] = OMIT,
|
|
516
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
517
|
+
) -> View:
|
|
518
|
+
"""
|
|
519
|
+
You can update a specific Data Manager view (tab) with additional filters and other customizations. You will need to supply the view ID. You can find this using [List views](list).
|
|
520
|
+
|
|
521
|
+
Parameters
|
|
522
|
+
----------
|
|
523
|
+
id : str
|
|
524
|
+
View ID
|
|
525
|
+
|
|
526
|
+
data : typing.Optional[ViewsUpdateRequestData]
|
|
527
|
+
Custom view data
|
|
528
|
+
|
|
529
|
+
project : typing.Optional[int]
|
|
530
|
+
Project ID
|
|
531
|
+
|
|
532
|
+
request_options : typing.Optional[RequestOptions]
|
|
533
|
+
Request-specific configuration.
|
|
534
|
+
|
|
535
|
+
Returns
|
|
536
|
+
-------
|
|
537
|
+
View
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
Examples
|
|
541
|
+
--------
|
|
542
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
543
|
+
|
|
544
|
+
client = AsyncLabelStudio(
|
|
545
|
+
api_key="YOUR_API_KEY",
|
|
546
|
+
)
|
|
547
|
+
await client.views.update(
|
|
548
|
+
id="id",
|
|
549
|
+
)
|
|
550
|
+
"""
|
|
551
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
552
|
+
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
553
|
+
method="PATCH",
|
|
554
|
+
json={"data": data, "project": project},
|
|
555
|
+
request_options=request_options,
|
|
556
|
+
omit=OMIT,
|
|
557
|
+
)
|
|
558
|
+
if 200 <= _response.status_code < 300:
|
|
559
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
560
|
+
try:
|
|
561
|
+
_response_json = _response.json()
|
|
562
|
+
except JSONDecodeError:
|
|
563
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
564
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|