label-studio-sdk 1.0.20__py3-none-any.whl → 2.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.
Potentially problematic release.
This version of label-studio-sdk might be problematic. Click here for more details.
- label_studio_sdk/__init__.py +325 -180
- label_studio_sdk/actions/__init__.py +4 -0
- label_studio_sdk/actions/client.py +46 -10
- label_studio_sdk/actions/types/__init__.py +4 -0
- label_studio_sdk/actions/types/actions_create_request_filters.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_id.py +7 -7
- label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +2 -2
- label_studio_sdk/actions/types/actions_list_response_item.py +25 -0
- label_studio_sdk/actions/types/actions_list_response_item_dialog.py +22 -0
- label_studio_sdk/annotations/__init__.py +2 -2
- label_studio_sdk/annotations/client.py +379 -243
- label_studio_sdk/annotations/types/__init__.py +4 -2
- label_studio_sdk/annotations/types/annotation_bulk_serializer_with_selected_items_request_last_action.py +7 -0
- label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +8 -5
- label_studio_sdk/base_client.py +28 -24
- label_studio_sdk/comments/client.py +378 -140
- label_studio_sdk/converter/README.md +207 -0
- label_studio_sdk/converter/imports/coco.py +132 -23
- label_studio_sdk/core/__init__.py +4 -0
- label_studio_sdk/core/unchecked_base_model.py +305 -0
- label_studio_sdk/environment.py +1 -1
- label_studio_sdk/errors/__init__.py +10 -1
- label_studio_sdk/errors/forbidden_error.py +9 -0
- label_studio_sdk/errors/method_not_allowed_error.py +9 -0
- label_studio_sdk/export_storage/__init__.py +1 -24
- label_studio_sdk/export_storage/azure/__init__.py +0 -3
- label_studio_sdk/export_storage/azure/client.py +231 -273
- label_studio_sdk/export_storage/client.py +5 -5
- label_studio_sdk/export_storage/gcs/__init__.py +0 -3
- label_studio_sdk/export_storage/gcs/client.py +231 -273
- label_studio_sdk/export_storage/local/__init__.py +0 -3
- label_studio_sdk/export_storage/local/client.py +211 -253
- label_studio_sdk/export_storage/redis/__init__.py +0 -3
- label_studio_sdk/export_storage/redis/client.py +239 -281
- label_studio_sdk/export_storage/s3/__init__.py +0 -3
- label_studio_sdk/export_storage/s3/client.py +254 -296
- label_studio_sdk/export_storage/s3s/client.py +694 -210
- label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +2 -2
- label_studio_sdk/files/client.py +52 -71
- label_studio_sdk/import_storage/__init__.py +1 -24
- label_studio_sdk/import_storage/azure/__init__.py +0 -3
- label_studio_sdk/import_storage/azure/client.py +249 -299
- label_studio_sdk/import_storage/client.py +5 -5
- label_studio_sdk/import_storage/gcs/__init__.py +0 -3
- label_studio_sdk/import_storage/gcs/client.py +249 -299
- label_studio_sdk/import_storage/local/__init__.py +0 -3
- label_studio_sdk/import_storage/local/client.py +211 -257
- label_studio_sdk/import_storage/redis/__init__.py +0 -3
- label_studio_sdk/import_storage/redis/client.py +239 -285
- label_studio_sdk/import_storage/s3/__init__.py +0 -3
- label_studio_sdk/import_storage/s3/client.py +274 -324
- label_studio_sdk/import_storage/s3s/client.py +728 -434
- label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +2 -2
- label_studio_sdk/jwt_settings/client.py +56 -58
- label_studio_sdk/label_interface/control_tags.py +48 -8
- label_studio_sdk/label_interface/interface.py +261 -56
- label_studio_sdk/ml/__init__.py +2 -16
- label_studio_sdk/ml/client.py +196 -179
- label_studio_sdk/ml/types/__init__.py +2 -12
- label_studio_sdk/ml/types/ml_list_model_versions_response.py +20 -0
- label_studio_sdk/model_providers/__init__.py +3 -0
- label_studio_sdk/model_providers/client.py +280 -228
- label_studio_sdk/model_providers/types/__init__.py +5 -0
- label_studio_sdk/{prompts/types/prompts_batch_predictions_response.py → model_providers/types/model_providers_list_model_provider_choices_response.py} +3 -3
- label_studio_sdk/organizations/__init__.py +5 -0
- label_studio_sdk/organizations/client.py +331 -0
- label_studio_sdk/organizations/members/__init__.py +2 -0
- label_studio_sdk/organizations/members/client.py +290 -0
- label_studio_sdk/predictions/client.py +29 -77
- label_studio_sdk/projects/__init__.py +18 -9
- label_studio_sdk/projects/client.py +905 -414
- label_studio_sdk/projects/exports/__init__.py +2 -2
- label_studio_sdk/projects/exports/client.py +336 -396
- label_studio_sdk/projects/exports/client_ext.py +30 -30
- label_studio_sdk/projects/exports/types/__init__.py +1 -2
- label_studio_sdk/projects/exports/types/exports_convert_response.py +5 -9
- label_studio_sdk/projects/pauses/client.py +114 -105
- label_studio_sdk/projects/stats/__init__.py +5 -0
- label_studio_sdk/projects/stats/client.py +175 -0
- label_studio_sdk/projects/stats/types/__init__.py +8 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response.py +44 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response_common_tasks.py +7 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response_iaa.py +5 -0
- label_studio_sdk/{types/base_task_file_upload.py → projects/stats/types/stats_iaa_response_std.py} +1 -1
- label_studio_sdk/projects/types/__init__.py +10 -6
- label_studio_sdk/projects/types/lse_project_create_request_sampling.py +7 -0
- label_studio_sdk/projects/types/lse_project_create_request_skip_queue.py +7 -0
- label_studio_sdk/projects/types/patched_lse_project_update_request_sampling.py +7 -0
- label_studio_sdk/projects/types/patched_lse_project_update_request_skip_queue.py +7 -0
- label_studio_sdk/{prompts/types/prompts_batch_failed_predictions_response.py → projects/types/projects_duplicate_response.py} +8 -5
- label_studio_sdk/projects/types/projects_import_tasks_response.py +2 -2
- label_studio_sdk/projects/types/projects_list_request_filter.py +1 -1
- label_studio_sdk/prompts/__init__.py +4 -10
- label_studio_sdk/prompts/client.py +511 -442
- label_studio_sdk/prompts/indicators/__init__.py +3 -0
- label_studio_sdk/prompts/indicators/client.py +47 -49
- label_studio_sdk/prompts/indicators/types/__init__.py +5 -0
- label_studio_sdk/{types/key_indicator_value.py → prompts/indicators/types/indicators_list_response_item.py} +3 -3
- label_studio_sdk/prompts/runs/client.py +113 -135
- label_studio_sdk/prompts/types/__init__.py +2 -12
- label_studio_sdk/prompts/types/prompts_compatible_projects_request_project_type.py +7 -0
- label_studio_sdk/prompts/versions/client.py +372 -312
- label_studio_sdk/tasks/__init__.py +2 -2
- label_studio_sdk/tasks/client.py +514 -213
- label_studio_sdk/tasks/types/__init__.py +1 -2
- label_studio_sdk/tokens/client.py +160 -152
- label_studio_sdk/tokens/client_ext.py +3 -3
- label_studio_sdk/types/__init__.py +258 -142
- label_studio_sdk/{webhooks/types/webhooks_update_request_actions_item.py → types/actions_enum.py} +4 -1
- label_studio_sdk/types/all_roles_project_list.py +197 -0
- label_studio_sdk/types/all_roles_project_list_sampling.py +7 -0
- label_studio_sdk/types/all_roles_project_list_skip_queue.py +7 -0
- label_studio_sdk/types/annotated_enum.py +5 -0
- label_studio_sdk/types/annotation.py +24 -10
- label_studio_sdk/types/annotation_last_action.py +3 -15
- label_studio_sdk/types/{annotations_dm_field.py → annotation_request.py} +21 -30
- label_studio_sdk/types/annotation_request_last_action.py +7 -0
- label_studio_sdk/types/assignment_settings.py +31 -0
- label_studio_sdk/types/assignment_settings_label_stream_task_distribution.py +7 -0
- label_studio_sdk/types/assignment_settings_request.py +32 -0
- label_studio_sdk/types/assignment_settings_request_label_stream_task_distribution.py +7 -0
- label_studio_sdk/types/{key_indicators_item_additional_kpis_item.py → associated_project.py} +9 -6
- label_studio_sdk/types/auth_method_enum.py +5 -0
- label_studio_sdk/types/azure_blob_export_storage.py +8 -12
- label_studio_sdk/types/azure_blob_import_storage.py +8 -12
- label_studio_sdk/types/{prompt_associated_projects_item_id.py → batch_failed_predictions.py} +4 -4
- label_studio_sdk/types/{access_token_response.py → batch_predictions.py} +6 -8
- label_studio_sdk/types/blank_enum.py +5 -0
- label_studio_sdk/types/{key_indicators_item_extra_kpis_item.py → blueprint_list.py} +12 -6
- label_studio_sdk/types/budget_reset_period_enum.py +5 -0
- label_studio_sdk/types/child_filter.py +44 -0
- label_studio_sdk/types/comment.py +39 -14
- label_studio_sdk/types/comment_request.py +32 -0
- label_studio_sdk/types/comment_serializer_with_expanded_user.py +53 -0
- label_studio_sdk/types/converted_format.py +5 -5
- label_studio_sdk/types/{api_token_response.py → converted_format_request.py} +8 -15
- label_studio_sdk/types/custom_scripts_editable_by_enum.py +5 -0
- label_studio_sdk/types/default_role_enum.py +5 -0
- label_studio_sdk/types/edition_enum.py +5 -0
- label_studio_sdk/types/export.py +7 -7
- label_studio_sdk/types/file_upload.py +5 -5
- label_studio_sdk/types/filter.py +9 -6
- label_studio_sdk/types/filter_group.py +3 -3
- label_studio_sdk/types/finished_enum.py +5 -0
- label_studio_sdk/types/gcs_export_storage.py +8 -12
- label_studio_sdk/types/gcs_import_storage.py +8 -12
- label_studio_sdk/types/{rotate_token_response.py → hotkeys.py} +5 -8
- label_studio_sdk/types/{base_task.py → import_api_request.py} +11 -34
- label_studio_sdk/types/inference_run_cost_estimate.py +2 -2
- label_studio_sdk/types/label_stream_task_distribution_enum.py +5 -0
- label_studio_sdk/types/{annotations_dm_field_last_action.py → last_action_enum.py} +1 -1
- label_studio_sdk/types/local_files_export_storage.py +8 -12
- label_studio_sdk/types/local_files_import_storage.py +8 -12
- label_studio_sdk/types/{annotation_filter_options.py → lse_annotation_filter_options.py} +12 -2
- label_studio_sdk/types/lse_annotation_filter_options_request.py +42 -0
- label_studio_sdk/types/lse_annotation_filter_options_request_reviewed.py +7 -0
- label_studio_sdk/types/lse_annotation_filter_options_reviewed.py +7 -0
- label_studio_sdk/types/{export_snapshot.py → lse_export_create.py} +11 -11
- label_studio_sdk/types/lse_fields.py +49 -0
- label_studio_sdk/types/lse_fields_onboarding_state.py +8 -0
- label_studio_sdk/types/lse_fields_trial_role.py +8 -0
- label_studio_sdk/types/lse_key_indicator_value.py +35 -0
- label_studio_sdk/types/lse_organization.py +57 -0
- label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +7 -0
- label_studio_sdk/types/lse_project_create.py +196 -0
- label_studio_sdk/types/lse_project_create_sampling.py +7 -0
- label_studio_sdk/types/lse_project_create_skip_queue.py +7 -0
- label_studio_sdk/types/lse_project_update.py +215 -0
- label_studio_sdk/types/lse_project_update_sampling.py +7 -0
- label_studio_sdk/types/lse_project_update_skip_queue.py +7 -0
- label_studio_sdk/types/lse_s3export_storage.py +134 -0
- label_studio_sdk/{import_storage/s3/types/s3create_response.py → types/lse_s3export_storage_request.py} +47 -21
- label_studio_sdk/{import_storage/s3/types/s3update_response.py → types/lse_s3import_storage.py} +60 -21
- label_studio_sdk/types/{s3s_import_storage.py → lse_s3import_storage_request.py} +32 -21
- label_studio_sdk/types/lse_task.py +117 -0
- label_studio_sdk/types/{data_manager_task_serializer_drafts_item.py → lse_task_drafts_item.py} +2 -2
- label_studio_sdk/types/lse_task_filter_options.py +63 -0
- label_studio_sdk/types/lse_task_filter_options_annotated.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_finished.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request.py +63 -0
- label_studio_sdk/types/lse_task_filter_options_request_annotated.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_finished.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_reviewed.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_skipped.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_reviewed.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_skipped.py +7 -0
- label_studio_sdk/types/{data_manager_task_serializer_predictions_item.py → lse_task_predictions_item.py} +4 -5
- label_studio_sdk/types/lse_task_serializer_for_annotators.py +54 -0
- label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +22 -0
- label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +28 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +117 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +22 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +28 -0
- label_studio_sdk/types/lse_user.py +49 -0
- label_studio_sdk/types/{base_user.py → lse_user_api.py} +17 -6
- label_studio_sdk/types/lseapi_token_create.py +21 -0
- label_studio_sdk/types/lseapi_token_list.py +21 -0
- label_studio_sdk/types/lsejwt_settings.py +32 -0
- label_studio_sdk/types/maybe_expanded_comment.py +7 -0
- label_studio_sdk/types/ml_backend.py +16 -17
- label_studio_sdk/types/mode_enum.py +5 -0
- label_studio_sdk/types/model_interface.py +44 -0
- label_studio_sdk/types/model_interface_request.py +40 -0
- label_studio_sdk/types/model_interface_serializer_get.py +45 -0
- label_studio_sdk/types/model_provider_connection.py +48 -17
- label_studio_sdk/types/model_provider_connection_budget_reset_period.py +3 -1
- label_studio_sdk/types/model_provider_connection_request.py +71 -0
- label_studio_sdk/types/model_run.py +40 -0
- label_studio_sdk/types/{inference_run_status.py → model_run_status_enum.py} +1 -1
- label_studio_sdk/types/null_enum.py +3 -0
- label_studio_sdk/types/onboarding_state_enum.py +7 -0
- label_studio_sdk/types/organization_billing.py +20 -0
- label_studio_sdk/types/organization_id.py +28 -0
- label_studio_sdk/types/organization_invite.py +20 -0
- label_studio_sdk/types/organization_member.py +37 -0
- label_studio_sdk/types/organization_membership.py +24 -0
- label_studio_sdk/{projects/types/projects_list_response.py → types/paginated_all_roles_project_list_list.py} +5 -5
- label_studio_sdk/types/{jwt_settings_response.py → paginated_role_based_task_list.py} +11 -9
- label_studio_sdk/types/pause.py +55 -14
- label_studio_sdk/types/pause_request.py +41 -0
- label_studio_sdk/types/prediction.py +7 -11
- label_studio_sdk/types/prediction_request.py +56 -0
- label_studio_sdk/types/project.py +32 -39
- label_studio_sdk/types/project_import.py +12 -13
- label_studio_sdk/types/project_label_config.py +2 -2
- label_studio_sdk/types/project_label_config_request.py +22 -0
- label_studio_sdk/types/project_sampling.py +3 -3
- label_studio_sdk/types/project_skip_queue.py +3 -1
- label_studio_sdk/types/project_subset_enum.py +5 -0
- label_studio_sdk/types/{prompt_version_provider.py → provider_enum.py} +1 -1
- label_studio_sdk/types/reason_enum.py +7 -0
- label_studio_sdk/types/redis_export_storage.py +8 -12
- label_studio_sdk/types/redis_import_storage.py +8 -12
- label_studio_sdk/types/refined_prompt_response.py +5 -6
- label_studio_sdk/types/requeue_rejected_tasks_mode_enum.py +5 -0
- label_studio_sdk/types/review_criteria_enum.py +5 -0
- label_studio_sdk/types/review_settings.py +80 -0
- label_studio_sdk/types/review_settings_request.py +80 -0
- label_studio_sdk/types/review_settings_request_requeue_rejected_tasks_mode.py +8 -0
- label_studio_sdk/types/review_settings_request_review_criteria.py +7 -0
- label_studio_sdk/types/review_settings_requeue_rejected_tasks_mode.py +8 -0
- label_studio_sdk/types/review_settings_review_criteria.py +7 -0
- label_studio_sdk/types/reviewed_enum.py +5 -0
- label_studio_sdk/types/role_based_task.py +8 -0
- label_studio_sdk/types/s3export_storage.py +8 -12
- label_studio_sdk/types/s3import_storage.py +8 -12
- label_studio_sdk/types/sampling_enum.py +7 -0
- label_studio_sdk/types/scope_enum.py +5 -0
- label_studio_sdk/types/selected_items_request.py +23 -0
- label_studio_sdk/types/serialization_option.py +2 -6
- label_studio_sdk/types/serialization_option_request.py +22 -0
- label_studio_sdk/types/serialization_options.py +17 -5
- label_studio_sdk/types/serialization_options_request.py +47 -0
- label_studio_sdk/types/skill_name_enum.py +5 -0
- label_studio_sdk/types/skip_queue_enum.py +5 -0
- label_studio_sdk/types/skipped_enum.py +5 -0
- label_studio_sdk/types/state_enum.py +5 -0
- label_studio_sdk/types/status7bf_enum.py +5 -0
- label_studio_sdk/types/{azure_blob_import_storage_status.py → status_c5a_enum.py} +2 -2
- label_studio_sdk/types/third_party_model_version.py +65 -0
- label_studio_sdk/types/third_party_model_version_request.py +54 -0
- label_studio_sdk/types/token_refresh_response.py +19 -0
- label_studio_sdk/types/token_rotate_response.py +19 -0
- label_studio_sdk/types/trial_role_enum.py +16 -0
- label_studio_sdk/types/user_simple.py +8 -5
- label_studio_sdk/types/user_simple_request.py +28 -0
- label_studio_sdk/types/version_response.py +49 -0
- label_studio_sdk/types/view.py +8 -15
- label_studio_sdk/types/webhook.py +9 -13
- label_studio_sdk/types/webhook_serializer_for_update.py +15 -13
- label_studio_sdk/types/workspace.py +14 -34
- label_studio_sdk/types/workspace_member_create.py +27 -0
- label_studio_sdk/types/workspace_member_list.py +24 -0
- label_studio_sdk/users/client.py +604 -87
- label_studio_sdk/users/types/users_get_token_response.py +4 -11
- label_studio_sdk/users/types/users_reset_token_response.py +4 -11
- label_studio_sdk/versions/__init__.py +0 -3
- label_studio_sdk/versions/client.py +14 -14
- label_studio_sdk/views/client.py +227 -141
- label_studio_sdk/views/types/views_create_request_data.py +2 -2
- label_studio_sdk/views/types/views_create_request_data_filters.py +2 -2
- label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +2 -2
- label_studio_sdk/views/types/views_update_request_data.py +2 -2
- label_studio_sdk/views/types/views_update_request_data_filters.py +2 -2
- label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +2 -2
- label_studio_sdk/webhooks/__init__.py +36 -2
- label_studio_sdk/webhooks/client.py +173 -367
- label_studio_sdk/webhooks/types/__init__.py +34 -2
- label_studio_sdk/webhooks/types/webhooks_info_response.py +80 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +24 -0
- label_studio_sdk/workspaces/__init__.py +1 -2
- label_studio_sdk/workspaces/client.py +97 -117
- label_studio_sdk/workspaces/members/__init__.py +0 -3
- label_studio_sdk/workspaces/members/client.py +65 -81
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/METADATA +1 -1
- label_studio_sdk-2.0.0.dist-info/RECORD +424 -0
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/WHEEL +1 -1
- label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +0 -34
- label_studio_sdk/export_storage/azure/types/__init__.py +0 -6
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +0 -57
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +0 -57
- label_studio_sdk/export_storage/gcs/types/__init__.py +0 -6
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +0 -57
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +0 -57
- label_studio_sdk/export_storage/local/types/__init__.py +0 -6
- label_studio_sdk/export_storage/local/types/local_create_response.py +0 -47
- label_studio_sdk/export_storage/local/types/local_update_response.py +0 -47
- label_studio_sdk/export_storage/redis/types/__init__.py +0 -6
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +0 -62
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +0 -62
- label_studio_sdk/export_storage/s3/types/__init__.py +0 -6
- label_studio_sdk/export_storage/s3/types/s3create_response.py +0 -81
- label_studio_sdk/export_storage/s3/types/s3update_response.py +0 -81
- label_studio_sdk/import_storage/azure/types/__init__.py +0 -6
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +0 -72
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +0 -72
- label_studio_sdk/import_storage/gcs/types/__init__.py +0 -6
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +0 -72
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +0 -72
- label_studio_sdk/import_storage/local/types/__init__.py +0 -6
- label_studio_sdk/import_storage/local/types/local_create_response.py +0 -47
- label_studio_sdk/import_storage/local/types/local_update_response.py +0 -47
- label_studio_sdk/import_storage/redis/types/__init__.py +0 -6
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +0 -62
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +0 -62
- label_studio_sdk/import_storage/s3/types/__init__.py +0 -6
- label_studio_sdk/ml/types/ml_create_response.py +0 -68
- label_studio_sdk/ml/types/ml_create_response_auth_method.py +0 -5
- label_studio_sdk/ml/types/ml_update_response.py +0 -68
- label_studio_sdk/ml/types/ml_update_response_auth_method.py +0 -5
- label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +0 -44
- label_studio_sdk/projects/types/projects_create_response.py +0 -91
- label_studio_sdk/projects/types/projects_update_response.py +0 -96
- label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +0 -32
- label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +0 -59
- label_studio_sdk/tasks/types/tasks_list_response.py +0 -38
- label_studio_sdk/types/annotation_completed_by.py +0 -6
- label_studio_sdk/types/azure_blob_export_storage_status.py +0 -7
- label_studio_sdk/types/base_task_updated_by.py +0 -7
- label_studio_sdk/types/comment_created_by.py +0 -5
- label_studio_sdk/types/converted_format_status.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer.py +0 -118
- label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer_comment_authors_item.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer_predictions_item_model_run.py +0 -5
- label_studio_sdk/types/export_format.py +0 -25
- label_studio_sdk/types/export_snapshot_status.py +0 -5
- label_studio_sdk/types/export_status.py +0 -5
- label_studio_sdk/types/gcs_export_storage_status.py +0 -7
- label_studio_sdk/types/gcs_import_storage_status.py +0 -7
- label_studio_sdk/types/inference_run.py +0 -34
- label_studio_sdk/types/inference_run_created_by.py +0 -5
- label_studio_sdk/types/inference_run_organization.py +0 -5
- label_studio_sdk/types/inference_run_project_subset.py +0 -5
- label_studio_sdk/types/key_indicators.py +0 -6
- label_studio_sdk/types/key_indicators_item.py +0 -41
- label_studio_sdk/types/local_files_export_storage_status.py +0 -7
- label_studio_sdk/types/local_files_import_storage_status.py +0 -7
- label_studio_sdk/types/ml_backend_auth_method.py +0 -5
- label_studio_sdk/types/ml_backend_state.py +0 -5
- label_studio_sdk/types/model_provider_connection_created_by.py +0 -5
- label_studio_sdk/types/model_provider_connection_organization.py +0 -5
- label_studio_sdk/types/model_provider_connection_provider.py +0 -7
- label_studio_sdk/types/model_provider_connection_scope.py +0 -5
- label_studio_sdk/types/pause_paused_by.py +0 -5
- label_studio_sdk/types/project_import_status.py +0 -5
- label_studio_sdk/types/prompt.py +0 -71
- label_studio_sdk/types/prompt_associated_projects_item.py +0 -6
- label_studio_sdk/types/prompt_created_by.py +0 -5
- label_studio_sdk/types/prompt_organization.py +0 -5
- label_studio_sdk/types/prompt_version.py +0 -32
- label_studio_sdk/types/prompt_version_created_by.py +0 -5
- label_studio_sdk/types/prompt_version_organization.py +0 -5
- label_studio_sdk/types/redis_export_storage_status.py +0 -7
- label_studio_sdk/types/redis_import_storage_status.py +0 -7
- label_studio_sdk/types/refined_prompt_response_refinement_status.py +0 -7
- label_studio_sdk/types/s3export_storage_status.py +0 -7
- label_studio_sdk/types/s3import_storage_status.py +0 -7
- label_studio_sdk/types/s3s_export_storage.py +0 -73
- label_studio_sdk/types/s3s_import_storage_status.py +0 -7
- label_studio_sdk/types/task.py +0 -156
- label_studio_sdk/types/task_annotators_item.py +0 -5
- label_studio_sdk/types/task_comment_authors_item.py +0 -5
- label_studio_sdk/types/task_filter_options.py +0 -39
- label_studio_sdk/types/webhook_actions_item.py +0 -21
- label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +0 -21
- label_studio_sdk/versions/types/__init__.py +0 -6
- label_studio_sdk/versions/types/versions_get_response.py +0 -73
- label_studio_sdk/versions/types/versions_get_response_edition.py +0 -5
- label_studio_sdk/workspaces/members/types/__init__.py +0 -6
- label_studio_sdk/workspaces/members/types/members_create_response.py +0 -22
- label_studio_sdk/workspaces/members/types/members_list_response_item.py +0 -22
- label_studio_sdk-1.0.20.dist-info/RECORD +0 -374
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/LICENSE +0 -0
|
@@ -4,12 +4,10 @@ import typing
|
|
|
4
4
|
from ...core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from ...core.request_options import RequestOptions
|
|
6
6
|
from ...types.s3export_storage import S3ExportStorage
|
|
7
|
-
from ...core.
|
|
7
|
+
from ...core.unchecked_base_model import construct_type
|
|
8
8
|
from json.decoder import JSONDecodeError
|
|
9
9
|
from ...core.api_error import ApiError
|
|
10
|
-
from .types.s3create_response import S3CreateResponse
|
|
11
10
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
12
|
-
from .types.s3update_response import S3UpdateResponse
|
|
13
11
|
from ...core.client_wrapper import AsyncClientWrapper
|
|
14
12
|
|
|
15
13
|
# this is used as the default value for optional parameters
|
|
@@ -21,18 +19,20 @@ class S3Client:
|
|
|
21
19
|
self._client_wrapper = client_wrapper
|
|
22
20
|
|
|
23
21
|
def list(
|
|
24
|
-
self,
|
|
22
|
+
self,
|
|
23
|
+
*,
|
|
24
|
+
ordering: typing.Optional[str] = None,
|
|
25
|
+
project: typing.Optional[int] = None,
|
|
26
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
25
27
|
) -> typing.List[S3ExportStorage]:
|
|
26
28
|
"""
|
|
27
|
-
|
|
28
|
-
You can connect your S3 bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all S3 export (target) storage connections for a specific project.
|
|
29
|
-
|
|
30
|
-
The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
|
|
31
|
-
|
|
32
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
29
|
+
Get a list of all S3 export storage connections.
|
|
33
30
|
|
|
34
31
|
Parameters
|
|
35
32
|
----------
|
|
33
|
+
ordering : typing.Optional[str]
|
|
34
|
+
Which field to use when ordering the results.
|
|
35
|
+
|
|
36
36
|
project : typing.Optional[int]
|
|
37
37
|
Project ID
|
|
38
38
|
|
|
@@ -57,6 +57,7 @@ class S3Client:
|
|
|
57
57
|
"api/storages/export/s3",
|
|
58
58
|
method="GET",
|
|
59
59
|
params={
|
|
60
|
+
"ordering": ordering,
|
|
60
61
|
"project": project,
|
|
61
62
|
},
|
|
62
63
|
request_options=request_options,
|
|
@@ -65,7 +66,7 @@ class S3Client:
|
|
|
65
66
|
if 200 <= _response.status_code < 300:
|
|
66
67
|
return typing.cast(
|
|
67
68
|
typing.List[S3ExportStorage],
|
|
68
|
-
|
|
69
|
+
construct_type(
|
|
69
70
|
type_=typing.List[S3ExportStorage], # type: ignore
|
|
70
71
|
object_=_response.json(),
|
|
71
72
|
),
|
|
@@ -91,14 +92,9 @@ class S3Client:
|
|
|
91
92
|
region_name: typing.Optional[str] = OMIT,
|
|
92
93
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
93
94
|
request_options: typing.Optional[RequestOptions] = None,
|
|
94
|
-
) ->
|
|
95
|
+
) -> S3ExportStorage:
|
|
95
96
|
"""
|
|
96
|
-
|
|
97
|
-
Create a new target storage connection to S3 storage.
|
|
98
|
-
|
|
99
|
-
For information about the required fields and prerequisites, see [Amazon S3](https://labelstud.io/guide/storage#Amazon-S3) in the Label Studio documentation.
|
|
100
|
-
|
|
101
|
-
<Tip>After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you [sync your connection](sync).</Tip>
|
|
97
|
+
Create a new S3 export storage connection to store annotations.
|
|
102
98
|
|
|
103
99
|
Parameters
|
|
104
100
|
----------
|
|
@@ -143,7 +139,7 @@ class S3Client:
|
|
|
143
139
|
|
|
144
140
|
Returns
|
|
145
141
|
-------
|
|
146
|
-
|
|
142
|
+
S3ExportStorage
|
|
147
143
|
|
|
148
144
|
|
|
149
145
|
Examples
|
|
@@ -181,9 +177,9 @@ class S3Client:
|
|
|
181
177
|
try:
|
|
182
178
|
if 200 <= _response.status_code < 300:
|
|
183
179
|
return typing.cast(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
type_=
|
|
180
|
+
S3ExportStorage,
|
|
181
|
+
construct_type(
|
|
182
|
+
type_=S3ExportStorage, # type: ignore
|
|
187
183
|
object_=_response.json(),
|
|
188
184
|
),
|
|
189
185
|
)
|
|
@@ -192,128 +188,13 @@ class S3Client:
|
|
|
192
188
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
193
189
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
194
190
|
|
|
195
|
-
def validate(
|
|
196
|
-
self,
|
|
197
|
-
*,
|
|
198
|
-
id: typing.Optional[int] = OMIT,
|
|
199
|
-
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
200
|
-
title: typing.Optional[str] = OMIT,
|
|
201
|
-
description: typing.Optional[str] = OMIT,
|
|
202
|
-
project: typing.Optional[int] = OMIT,
|
|
203
|
-
bucket: typing.Optional[str] = OMIT,
|
|
204
|
-
prefix: typing.Optional[str] = OMIT,
|
|
205
|
-
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
206
|
-
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
207
|
-
aws_session_token: typing.Optional[str] = OMIT,
|
|
208
|
-
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
209
|
-
region_name: typing.Optional[str] = OMIT,
|
|
210
|
-
s3endpoint: typing.Optional[str] = OMIT,
|
|
211
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
212
|
-
) -> None:
|
|
213
|
-
"""
|
|
214
|
-
|
|
215
|
-
Validate a specific S3 export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
|
|
216
|
-
|
|
217
|
-
Parameters
|
|
218
|
-
----------
|
|
219
|
-
id : typing.Optional[int]
|
|
220
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
221
|
-
|
|
222
|
-
can_delete_objects : typing.Optional[bool]
|
|
223
|
-
Deletion from storage enabled.
|
|
224
|
-
|
|
225
|
-
title : typing.Optional[str]
|
|
226
|
-
Storage title
|
|
227
|
-
|
|
228
|
-
description : typing.Optional[str]
|
|
229
|
-
Storage description
|
|
230
|
-
|
|
231
|
-
project : typing.Optional[int]
|
|
232
|
-
Project ID
|
|
233
|
-
|
|
234
|
-
bucket : typing.Optional[str]
|
|
235
|
-
S3 bucket name
|
|
236
|
-
|
|
237
|
-
prefix : typing.Optional[str]
|
|
238
|
-
S3 bucket prefix
|
|
239
|
-
|
|
240
|
-
aws_access_key_id : typing.Optional[str]
|
|
241
|
-
AWS_ACCESS_KEY_ID
|
|
242
|
-
|
|
243
|
-
aws_secret_access_key : typing.Optional[str]
|
|
244
|
-
AWS_SECRET_ACCESS_KEY
|
|
245
|
-
|
|
246
|
-
aws_session_token : typing.Optional[str]
|
|
247
|
-
AWS_SESSION_TOKEN
|
|
248
|
-
|
|
249
|
-
aws_sse_kms_key_id : typing.Optional[str]
|
|
250
|
-
AWS SSE KMS Key ID
|
|
251
|
-
|
|
252
|
-
region_name : typing.Optional[str]
|
|
253
|
-
AWS Region
|
|
254
|
-
|
|
255
|
-
s3endpoint : typing.Optional[str]
|
|
256
|
-
S3 Endpoint
|
|
257
|
-
|
|
258
|
-
request_options : typing.Optional[RequestOptions]
|
|
259
|
-
Request-specific configuration.
|
|
260
|
-
|
|
261
|
-
Returns
|
|
262
|
-
-------
|
|
263
|
-
None
|
|
264
|
-
|
|
265
|
-
Examples
|
|
266
|
-
--------
|
|
267
|
-
from label_studio_sdk import LabelStudio
|
|
268
|
-
|
|
269
|
-
client = LabelStudio(
|
|
270
|
-
api_key="YOUR_API_KEY",
|
|
271
|
-
)
|
|
272
|
-
client.export_storage.s3.validate()
|
|
273
|
-
"""
|
|
274
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
275
|
-
"api/storages/export/s3/validate",
|
|
276
|
-
method="POST",
|
|
277
|
-
json={
|
|
278
|
-
"id": id,
|
|
279
|
-
"can_delete_objects": can_delete_objects,
|
|
280
|
-
"title": title,
|
|
281
|
-
"description": description,
|
|
282
|
-
"project": project,
|
|
283
|
-
"bucket": bucket,
|
|
284
|
-
"prefix": prefix,
|
|
285
|
-
"aws_access_key_id": aws_access_key_id,
|
|
286
|
-
"aws_secret_access_key": aws_secret_access_key,
|
|
287
|
-
"aws_session_token": aws_session_token,
|
|
288
|
-
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
289
|
-
"region_name": region_name,
|
|
290
|
-
"s3_endpoint": s3endpoint,
|
|
291
|
-
},
|
|
292
|
-
headers={
|
|
293
|
-
"content-type": "application/json",
|
|
294
|
-
},
|
|
295
|
-
request_options=request_options,
|
|
296
|
-
omit=OMIT,
|
|
297
|
-
)
|
|
298
|
-
try:
|
|
299
|
-
if 200 <= _response.status_code < 300:
|
|
300
|
-
return
|
|
301
|
-
_response_json = _response.json()
|
|
302
|
-
except JSONDecodeError:
|
|
303
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
304
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
305
|
-
|
|
306
191
|
def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> S3ExportStorage:
|
|
307
192
|
"""
|
|
308
|
-
|
|
309
|
-
Get a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
310
|
-
|
|
311
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
193
|
+
Get a specific S3 export storage connection.
|
|
312
194
|
|
|
313
195
|
Parameters
|
|
314
196
|
----------
|
|
315
197
|
id : int
|
|
316
|
-
A unique integer value identifying this s3 export storage.
|
|
317
198
|
|
|
318
199
|
request_options : typing.Optional[RequestOptions]
|
|
319
200
|
Request-specific configuration.
|
|
@@ -343,7 +224,7 @@ class S3Client:
|
|
|
343
224
|
if 200 <= _response.status_code < 300:
|
|
344
225
|
return typing.cast(
|
|
345
226
|
S3ExportStorage,
|
|
346
|
-
|
|
227
|
+
construct_type(
|
|
347
228
|
type_=S3ExportStorage, # type: ignore
|
|
348
229
|
object_=_response.json(),
|
|
349
230
|
),
|
|
@@ -355,15 +236,11 @@ class S3Client:
|
|
|
355
236
|
|
|
356
237
|
def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
357
238
|
"""
|
|
358
|
-
|
|
359
|
-
Delete a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
360
|
-
|
|
361
|
-
Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the [Delete tasks](../../tasks/delete-all-tasks) API.
|
|
239
|
+
Delete a specific S3 export storage connection.
|
|
362
240
|
|
|
363
241
|
Parameters
|
|
364
242
|
----------
|
|
365
243
|
id : int
|
|
366
|
-
A unique integer value identifying this s3 export storage.
|
|
367
244
|
|
|
368
245
|
request_options : typing.Optional[RequestOptions]
|
|
369
246
|
Request-specific configuration.
|
|
@@ -413,17 +290,13 @@ class S3Client:
|
|
|
413
290
|
region_name: typing.Optional[str] = OMIT,
|
|
414
291
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
415
292
|
request_options: typing.Optional[RequestOptions] = None,
|
|
416
|
-
) ->
|
|
293
|
+
) -> S3ExportStorage:
|
|
417
294
|
"""
|
|
418
|
-
|
|
419
|
-
Update a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
420
|
-
|
|
421
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
295
|
+
Update a specific S3 export storage connection.
|
|
422
296
|
|
|
423
297
|
Parameters
|
|
424
298
|
----------
|
|
425
299
|
id : int
|
|
426
|
-
A unique integer value identifying this s3 export storage.
|
|
427
300
|
|
|
428
301
|
can_delete_objects : typing.Optional[bool]
|
|
429
302
|
Deletion from storage enabled.
|
|
@@ -466,7 +339,7 @@ class S3Client:
|
|
|
466
339
|
|
|
467
340
|
Returns
|
|
468
341
|
-------
|
|
469
|
-
|
|
342
|
+
S3ExportStorage
|
|
470
343
|
|
|
471
344
|
|
|
472
345
|
Examples
|
|
@@ -506,9 +379,9 @@ class S3Client:
|
|
|
506
379
|
try:
|
|
507
380
|
if 200 <= _response.status_code < 300:
|
|
508
381
|
return typing.cast(
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
type_=
|
|
382
|
+
S3ExportStorage,
|
|
383
|
+
construct_type(
|
|
384
|
+
type_=S3ExportStorage, # type: ignore
|
|
512
385
|
object_=_response.json(),
|
|
513
386
|
),
|
|
514
387
|
)
|
|
@@ -519,12 +392,7 @@ class S3Client:
|
|
|
519
392
|
|
|
520
393
|
def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> S3ExportStorage:
|
|
521
394
|
"""
|
|
522
|
-
|
|
523
|
-
Sync tasks to an S3 export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
524
|
-
|
|
525
|
-
Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.
|
|
526
|
-
|
|
527
|
-
<Note>Before proceeding, you should review [How sync operations work - Source storage](https://labelstud.io/guide/storage#Source-storage) to ensure that your data remains secure and private.</Note>
|
|
395
|
+
Sync tasks from an S3 export storage connection.
|
|
528
396
|
|
|
529
397
|
Parameters
|
|
530
398
|
----------
|
|
@@ -558,7 +426,7 @@ class S3Client:
|
|
|
558
426
|
if 200 <= _response.status_code < 300:
|
|
559
427
|
return typing.cast(
|
|
560
428
|
S3ExportStorage,
|
|
561
|
-
|
|
429
|
+
construct_type(
|
|
562
430
|
type_=S3ExportStorage, # type: ignore
|
|
563
431
|
object_=_response.json(),
|
|
564
432
|
),
|
|
@@ -568,77 +436,10 @@ class S3Client:
|
|
|
568
436
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
569
437
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
570
438
|
|
|
571
|
-
|
|
572
|
-
class AsyncS3Client:
|
|
573
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
574
|
-
self._client_wrapper = client_wrapper
|
|
575
|
-
|
|
576
|
-
async def list(
|
|
577
|
-
self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
578
|
-
) -> typing.List[S3ExportStorage]:
|
|
579
|
-
"""
|
|
580
|
-
|
|
581
|
-
You can connect your S3 bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all S3 export (target) storage connections for a specific project.
|
|
582
|
-
|
|
583
|
-
The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
|
|
584
|
-
|
|
585
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
586
|
-
|
|
587
|
-
Parameters
|
|
588
|
-
----------
|
|
589
|
-
project : typing.Optional[int]
|
|
590
|
-
Project ID
|
|
591
|
-
|
|
592
|
-
request_options : typing.Optional[RequestOptions]
|
|
593
|
-
Request-specific configuration.
|
|
594
|
-
|
|
595
|
-
Returns
|
|
596
|
-
-------
|
|
597
|
-
typing.List[S3ExportStorage]
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
Examples
|
|
601
|
-
--------
|
|
602
|
-
import asyncio
|
|
603
|
-
|
|
604
|
-
from label_studio_sdk import AsyncLabelStudio
|
|
605
|
-
|
|
606
|
-
client = AsyncLabelStudio(
|
|
607
|
-
api_key="YOUR_API_KEY",
|
|
608
|
-
)
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
async def main() -> None:
|
|
612
|
-
await client.export_storage.s3.list()
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
asyncio.run(main())
|
|
616
|
-
"""
|
|
617
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
618
|
-
"api/storages/export/s3",
|
|
619
|
-
method="GET",
|
|
620
|
-
params={
|
|
621
|
-
"project": project,
|
|
622
|
-
},
|
|
623
|
-
request_options=request_options,
|
|
624
|
-
)
|
|
625
|
-
try:
|
|
626
|
-
if 200 <= _response.status_code < 300:
|
|
627
|
-
return typing.cast(
|
|
628
|
-
typing.List[S3ExportStorage],
|
|
629
|
-
parse_obj_as(
|
|
630
|
-
type_=typing.List[S3ExportStorage], # type: ignore
|
|
631
|
-
object_=_response.json(),
|
|
632
|
-
),
|
|
633
|
-
)
|
|
634
|
-
_response_json = _response.json()
|
|
635
|
-
except JSONDecodeError:
|
|
636
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
637
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
638
|
-
|
|
639
|
-
async def create(
|
|
439
|
+
def validate(
|
|
640
440
|
self,
|
|
641
441
|
*,
|
|
442
|
+
id: typing.Optional[int] = OMIT,
|
|
642
443
|
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
643
444
|
title: typing.Optional[str] = OMIT,
|
|
644
445
|
description: typing.Optional[str] = OMIT,
|
|
@@ -652,17 +453,15 @@ class AsyncS3Client:
|
|
|
652
453
|
region_name: typing.Optional[str] = OMIT,
|
|
653
454
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
654
455
|
request_options: typing.Optional[RequestOptions] = None,
|
|
655
|
-
) ->
|
|
456
|
+
) -> None:
|
|
656
457
|
"""
|
|
657
|
-
|
|
658
|
-
Create a new target storage connection to S3 storage.
|
|
659
|
-
|
|
660
|
-
For information about the required fields and prerequisites, see [Amazon S3](https://labelstud.io/guide/storage#Amazon-S3) in the Label Studio documentation.
|
|
661
|
-
|
|
662
|
-
<Tip>After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you [sync your connection](sync).</Tip>
|
|
458
|
+
Validate a specific S3 export storage connection.
|
|
663
459
|
|
|
664
460
|
Parameters
|
|
665
461
|
----------
|
|
462
|
+
id : typing.Optional[int]
|
|
463
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
464
|
+
|
|
666
465
|
can_delete_objects : typing.Optional[bool]
|
|
667
466
|
Deletion from storage enabled.
|
|
668
467
|
|
|
@@ -704,30 +503,22 @@ class AsyncS3Client:
|
|
|
704
503
|
|
|
705
504
|
Returns
|
|
706
505
|
-------
|
|
707
|
-
|
|
708
|
-
|
|
506
|
+
None
|
|
709
507
|
|
|
710
508
|
Examples
|
|
711
509
|
--------
|
|
712
|
-
import
|
|
713
|
-
|
|
714
|
-
from label_studio_sdk import AsyncLabelStudio
|
|
510
|
+
from label_studio_sdk import LabelStudio
|
|
715
511
|
|
|
716
|
-
client =
|
|
512
|
+
client = LabelStudio(
|
|
717
513
|
api_key="YOUR_API_KEY",
|
|
718
514
|
)
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
async def main() -> None:
|
|
722
|
-
await client.export_storage.s3.create()
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
asyncio.run(main())
|
|
515
|
+
client.export_storage.s3.validate()
|
|
726
516
|
"""
|
|
727
|
-
_response =
|
|
728
|
-
"api/storages/export/s3",
|
|
517
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
518
|
+
"api/storages/export/s3/validate",
|
|
729
519
|
method="POST",
|
|
730
520
|
json={
|
|
521
|
+
"id": id,
|
|
731
522
|
"can_delete_objects": can_delete_objects,
|
|
732
523
|
"title": title,
|
|
733
524
|
"description": description,
|
|
@@ -747,12 +538,77 @@ class AsyncS3Client:
|
|
|
747
538
|
request_options=request_options,
|
|
748
539
|
omit=OMIT,
|
|
749
540
|
)
|
|
541
|
+
try:
|
|
542
|
+
if 200 <= _response.status_code < 300:
|
|
543
|
+
return
|
|
544
|
+
_response_json = _response.json()
|
|
545
|
+
except JSONDecodeError:
|
|
546
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
547
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
class AsyncS3Client:
|
|
551
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
552
|
+
self._client_wrapper = client_wrapper
|
|
553
|
+
|
|
554
|
+
async def list(
|
|
555
|
+
self,
|
|
556
|
+
*,
|
|
557
|
+
ordering: typing.Optional[str] = None,
|
|
558
|
+
project: typing.Optional[int] = None,
|
|
559
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
560
|
+
) -> typing.List[S3ExportStorage]:
|
|
561
|
+
"""
|
|
562
|
+
Get a list of all S3 export storage connections.
|
|
563
|
+
|
|
564
|
+
Parameters
|
|
565
|
+
----------
|
|
566
|
+
ordering : typing.Optional[str]
|
|
567
|
+
Which field to use when ordering the results.
|
|
568
|
+
|
|
569
|
+
project : typing.Optional[int]
|
|
570
|
+
Project ID
|
|
571
|
+
|
|
572
|
+
request_options : typing.Optional[RequestOptions]
|
|
573
|
+
Request-specific configuration.
|
|
574
|
+
|
|
575
|
+
Returns
|
|
576
|
+
-------
|
|
577
|
+
typing.List[S3ExportStorage]
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
Examples
|
|
581
|
+
--------
|
|
582
|
+
import asyncio
|
|
583
|
+
|
|
584
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
585
|
+
|
|
586
|
+
client = AsyncLabelStudio(
|
|
587
|
+
api_key="YOUR_API_KEY",
|
|
588
|
+
)
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
async def main() -> None:
|
|
592
|
+
await client.export_storage.s3.list()
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
asyncio.run(main())
|
|
596
|
+
"""
|
|
597
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
598
|
+
"api/storages/export/s3",
|
|
599
|
+
method="GET",
|
|
600
|
+
params={
|
|
601
|
+
"ordering": ordering,
|
|
602
|
+
"project": project,
|
|
603
|
+
},
|
|
604
|
+
request_options=request_options,
|
|
605
|
+
)
|
|
750
606
|
try:
|
|
751
607
|
if 200 <= _response.status_code < 300:
|
|
752
608
|
return typing.cast(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
type_=
|
|
609
|
+
typing.List[S3ExportStorage],
|
|
610
|
+
construct_type(
|
|
611
|
+
type_=typing.List[S3ExportStorage], # type: ignore
|
|
756
612
|
object_=_response.json(),
|
|
757
613
|
),
|
|
758
614
|
)
|
|
@@ -761,10 +617,9 @@ class AsyncS3Client:
|
|
|
761
617
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
762
618
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
763
619
|
|
|
764
|
-
async def
|
|
620
|
+
async def create(
|
|
765
621
|
self,
|
|
766
622
|
*,
|
|
767
|
-
id: typing.Optional[int] = OMIT,
|
|
768
623
|
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
769
624
|
title: typing.Optional[str] = OMIT,
|
|
770
625
|
description: typing.Optional[str] = OMIT,
|
|
@@ -778,16 +633,12 @@ class AsyncS3Client:
|
|
|
778
633
|
region_name: typing.Optional[str] = OMIT,
|
|
779
634
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
780
635
|
request_options: typing.Optional[RequestOptions] = None,
|
|
781
|
-
) ->
|
|
636
|
+
) -> S3ExportStorage:
|
|
782
637
|
"""
|
|
783
|
-
|
|
784
|
-
Validate a specific S3 export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
|
|
638
|
+
Create a new S3 export storage connection to store annotations.
|
|
785
639
|
|
|
786
640
|
Parameters
|
|
787
641
|
----------
|
|
788
|
-
id : typing.Optional[int]
|
|
789
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
790
|
-
|
|
791
642
|
can_delete_objects : typing.Optional[bool]
|
|
792
643
|
Deletion from storage enabled.
|
|
793
644
|
|
|
@@ -829,7 +680,8 @@ class AsyncS3Client:
|
|
|
829
680
|
|
|
830
681
|
Returns
|
|
831
682
|
-------
|
|
832
|
-
|
|
683
|
+
S3ExportStorage
|
|
684
|
+
|
|
833
685
|
|
|
834
686
|
Examples
|
|
835
687
|
--------
|
|
@@ -843,16 +695,15 @@ class AsyncS3Client:
|
|
|
843
695
|
|
|
844
696
|
|
|
845
697
|
async def main() -> None:
|
|
846
|
-
await client.export_storage.s3.
|
|
698
|
+
await client.export_storage.s3.create()
|
|
847
699
|
|
|
848
700
|
|
|
849
701
|
asyncio.run(main())
|
|
850
702
|
"""
|
|
851
703
|
_response = await self._client_wrapper.httpx_client.request(
|
|
852
|
-
"api/storages/export/s3
|
|
704
|
+
"api/storages/export/s3",
|
|
853
705
|
method="POST",
|
|
854
706
|
json={
|
|
855
|
-
"id": id,
|
|
856
707
|
"can_delete_objects": can_delete_objects,
|
|
857
708
|
"title": title,
|
|
858
709
|
"description": description,
|
|
@@ -874,7 +725,13 @@ class AsyncS3Client:
|
|
|
874
725
|
)
|
|
875
726
|
try:
|
|
876
727
|
if 200 <= _response.status_code < 300:
|
|
877
|
-
return
|
|
728
|
+
return typing.cast(
|
|
729
|
+
S3ExportStorage,
|
|
730
|
+
construct_type(
|
|
731
|
+
type_=S3ExportStorage, # type: ignore
|
|
732
|
+
object_=_response.json(),
|
|
733
|
+
),
|
|
734
|
+
)
|
|
878
735
|
_response_json = _response.json()
|
|
879
736
|
except JSONDecodeError:
|
|
880
737
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -882,15 +739,11 @@ class AsyncS3Client:
|
|
|
882
739
|
|
|
883
740
|
async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> S3ExportStorage:
|
|
884
741
|
"""
|
|
885
|
-
|
|
886
|
-
Get a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
887
|
-
|
|
888
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
742
|
+
Get a specific S3 export storage connection.
|
|
889
743
|
|
|
890
744
|
Parameters
|
|
891
745
|
----------
|
|
892
746
|
id : int
|
|
893
|
-
A unique integer value identifying this s3 export storage.
|
|
894
747
|
|
|
895
748
|
request_options : typing.Optional[RequestOptions]
|
|
896
749
|
Request-specific configuration.
|
|
@@ -928,7 +781,7 @@ class AsyncS3Client:
|
|
|
928
781
|
if 200 <= _response.status_code < 300:
|
|
929
782
|
return typing.cast(
|
|
930
783
|
S3ExportStorage,
|
|
931
|
-
|
|
784
|
+
construct_type(
|
|
932
785
|
type_=S3ExportStorage, # type: ignore
|
|
933
786
|
object_=_response.json(),
|
|
934
787
|
),
|
|
@@ -940,15 +793,11 @@ class AsyncS3Client:
|
|
|
940
793
|
|
|
941
794
|
async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
942
795
|
"""
|
|
943
|
-
|
|
944
|
-
Delete a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
945
|
-
|
|
946
|
-
Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the [Delete tasks](../../tasks/delete-all-tasks) API.
|
|
796
|
+
Delete a specific S3 export storage connection.
|
|
947
797
|
|
|
948
798
|
Parameters
|
|
949
799
|
----------
|
|
950
800
|
id : int
|
|
951
|
-
A unique integer value identifying this s3 export storage.
|
|
952
801
|
|
|
953
802
|
request_options : typing.Optional[RequestOptions]
|
|
954
803
|
Request-specific configuration.
|
|
@@ -1006,17 +855,13 @@ class AsyncS3Client:
|
|
|
1006
855
|
region_name: typing.Optional[str] = OMIT,
|
|
1007
856
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
1008
857
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1009
|
-
) ->
|
|
858
|
+
) -> S3ExportStorage:
|
|
1010
859
|
"""
|
|
1011
|
-
|
|
1012
|
-
Update a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
1013
|
-
|
|
1014
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
860
|
+
Update a specific S3 export storage connection.
|
|
1015
861
|
|
|
1016
862
|
Parameters
|
|
1017
863
|
----------
|
|
1018
864
|
id : int
|
|
1019
|
-
A unique integer value identifying this s3 export storage.
|
|
1020
865
|
|
|
1021
866
|
can_delete_objects : typing.Optional[bool]
|
|
1022
867
|
Deletion from storage enabled.
|
|
@@ -1059,7 +904,7 @@ class AsyncS3Client:
|
|
|
1059
904
|
|
|
1060
905
|
Returns
|
|
1061
906
|
-------
|
|
1062
|
-
|
|
907
|
+
S3ExportStorage
|
|
1063
908
|
|
|
1064
909
|
|
|
1065
910
|
Examples
|
|
@@ -1107,9 +952,9 @@ class AsyncS3Client:
|
|
|
1107
952
|
try:
|
|
1108
953
|
if 200 <= _response.status_code < 300:
|
|
1109
954
|
return typing.cast(
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
type_=
|
|
955
|
+
S3ExportStorage,
|
|
956
|
+
construct_type(
|
|
957
|
+
type_=S3ExportStorage, # type: ignore
|
|
1113
958
|
object_=_response.json(),
|
|
1114
959
|
),
|
|
1115
960
|
)
|
|
@@ -1120,12 +965,7 @@ class AsyncS3Client:
|
|
|
1120
965
|
|
|
1121
966
|
async def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> S3ExportStorage:
|
|
1122
967
|
"""
|
|
1123
|
-
|
|
1124
|
-
Sync tasks to an S3 export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
1125
|
-
|
|
1126
|
-
Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.
|
|
1127
|
-
|
|
1128
|
-
<Note>Before proceeding, you should review [How sync operations work - Source storage](https://labelstud.io/guide/storage#Source-storage) to ensure that your data remains secure and private.</Note>
|
|
968
|
+
Sync tasks from an S3 export storage connection.
|
|
1129
969
|
|
|
1130
970
|
Parameters
|
|
1131
971
|
----------
|
|
@@ -1167,7 +1007,7 @@ class AsyncS3Client:
|
|
|
1167
1007
|
if 200 <= _response.status_code < 300:
|
|
1168
1008
|
return typing.cast(
|
|
1169
1009
|
S3ExportStorage,
|
|
1170
|
-
|
|
1010
|
+
construct_type(
|
|
1171
1011
|
type_=S3ExportStorage, # type: ignore
|
|
1172
1012
|
object_=_response.json(),
|
|
1173
1013
|
),
|
|
@@ -1176,3 +1016,121 @@ class AsyncS3Client:
|
|
|
1176
1016
|
except JSONDecodeError:
|
|
1177
1017
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1178
1018
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1019
|
+
|
|
1020
|
+
async def validate(
|
|
1021
|
+
self,
|
|
1022
|
+
*,
|
|
1023
|
+
id: typing.Optional[int] = OMIT,
|
|
1024
|
+
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
1025
|
+
title: typing.Optional[str] = OMIT,
|
|
1026
|
+
description: typing.Optional[str] = OMIT,
|
|
1027
|
+
project: typing.Optional[int] = OMIT,
|
|
1028
|
+
bucket: typing.Optional[str] = OMIT,
|
|
1029
|
+
prefix: typing.Optional[str] = OMIT,
|
|
1030
|
+
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
1031
|
+
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
1032
|
+
aws_session_token: typing.Optional[str] = OMIT,
|
|
1033
|
+
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
1034
|
+
region_name: typing.Optional[str] = OMIT,
|
|
1035
|
+
s3endpoint: typing.Optional[str] = OMIT,
|
|
1036
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1037
|
+
) -> None:
|
|
1038
|
+
"""
|
|
1039
|
+
Validate a specific S3 export storage connection.
|
|
1040
|
+
|
|
1041
|
+
Parameters
|
|
1042
|
+
----------
|
|
1043
|
+
id : typing.Optional[int]
|
|
1044
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
1045
|
+
|
|
1046
|
+
can_delete_objects : typing.Optional[bool]
|
|
1047
|
+
Deletion from storage enabled.
|
|
1048
|
+
|
|
1049
|
+
title : typing.Optional[str]
|
|
1050
|
+
Storage title
|
|
1051
|
+
|
|
1052
|
+
description : typing.Optional[str]
|
|
1053
|
+
Storage description
|
|
1054
|
+
|
|
1055
|
+
project : typing.Optional[int]
|
|
1056
|
+
Project ID
|
|
1057
|
+
|
|
1058
|
+
bucket : typing.Optional[str]
|
|
1059
|
+
S3 bucket name
|
|
1060
|
+
|
|
1061
|
+
prefix : typing.Optional[str]
|
|
1062
|
+
S3 bucket prefix
|
|
1063
|
+
|
|
1064
|
+
aws_access_key_id : typing.Optional[str]
|
|
1065
|
+
AWS_ACCESS_KEY_ID
|
|
1066
|
+
|
|
1067
|
+
aws_secret_access_key : typing.Optional[str]
|
|
1068
|
+
AWS_SECRET_ACCESS_KEY
|
|
1069
|
+
|
|
1070
|
+
aws_session_token : typing.Optional[str]
|
|
1071
|
+
AWS_SESSION_TOKEN
|
|
1072
|
+
|
|
1073
|
+
aws_sse_kms_key_id : typing.Optional[str]
|
|
1074
|
+
AWS SSE KMS Key ID
|
|
1075
|
+
|
|
1076
|
+
region_name : typing.Optional[str]
|
|
1077
|
+
AWS Region
|
|
1078
|
+
|
|
1079
|
+
s3endpoint : typing.Optional[str]
|
|
1080
|
+
S3 Endpoint
|
|
1081
|
+
|
|
1082
|
+
request_options : typing.Optional[RequestOptions]
|
|
1083
|
+
Request-specific configuration.
|
|
1084
|
+
|
|
1085
|
+
Returns
|
|
1086
|
+
-------
|
|
1087
|
+
None
|
|
1088
|
+
|
|
1089
|
+
Examples
|
|
1090
|
+
--------
|
|
1091
|
+
import asyncio
|
|
1092
|
+
|
|
1093
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
1094
|
+
|
|
1095
|
+
client = AsyncLabelStudio(
|
|
1096
|
+
api_key="YOUR_API_KEY",
|
|
1097
|
+
)
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
async def main() -> None:
|
|
1101
|
+
await client.export_storage.s3.validate()
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
asyncio.run(main())
|
|
1105
|
+
"""
|
|
1106
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1107
|
+
"api/storages/export/s3/validate",
|
|
1108
|
+
method="POST",
|
|
1109
|
+
json={
|
|
1110
|
+
"id": id,
|
|
1111
|
+
"can_delete_objects": can_delete_objects,
|
|
1112
|
+
"title": title,
|
|
1113
|
+
"description": description,
|
|
1114
|
+
"project": project,
|
|
1115
|
+
"bucket": bucket,
|
|
1116
|
+
"prefix": prefix,
|
|
1117
|
+
"aws_access_key_id": aws_access_key_id,
|
|
1118
|
+
"aws_secret_access_key": aws_secret_access_key,
|
|
1119
|
+
"aws_session_token": aws_session_token,
|
|
1120
|
+
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
1121
|
+
"region_name": region_name,
|
|
1122
|
+
"s3_endpoint": s3endpoint,
|
|
1123
|
+
},
|
|
1124
|
+
headers={
|
|
1125
|
+
"content-type": "application/json",
|
|
1126
|
+
},
|
|
1127
|
+
request_options=request_options,
|
|
1128
|
+
omit=OMIT,
|
|
1129
|
+
)
|
|
1130
|
+
try:
|
|
1131
|
+
if 200 <= _response.status_code < 300:
|
|
1132
|
+
return
|
|
1133
|
+
_response_json = _response.json()
|
|
1134
|
+
except JSONDecodeError:
|
|
1135
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1136
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|