label-studio-sdk 1.0.19__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.19.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.19.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.19.dist-info/RECORD +0 -374
- {label_studio_sdk-1.0.19.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.local_files_export_storage import LocalFilesExportStorage
|
|
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.local_create_response import LocalCreateResponse
|
|
11
10
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
12
|
-
from .types.local_update_response import LocalUpdateResponse
|
|
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 LocalClient:
|
|
|
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[LocalFilesExportStorage]:
|
|
26
28
|
"""
|
|
27
|
-
|
|
28
|
-
You can connect a local file directory to Label Studio as a source storage or target storage. Use this API request to get a list of all local file 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 local file 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 LocalClient:
|
|
|
57
57
|
"api/storages/export/localfiles",
|
|
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 LocalClient:
|
|
|
65
66
|
if 200 <= _response.status_code < 300:
|
|
66
67
|
return typing.cast(
|
|
67
68
|
typing.List[LocalFilesExportStorage],
|
|
68
|
-
|
|
69
|
+
construct_type(
|
|
69
70
|
type_=typing.List[LocalFilesExportStorage], # type: ignore
|
|
70
71
|
object_=_response.json(),
|
|
71
72
|
),
|
|
@@ -85,14 +86,9 @@ class LocalClient:
|
|
|
85
86
|
regex_filter: typing.Optional[str] = OMIT,
|
|
86
87
|
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
87
88
|
request_options: typing.Optional[RequestOptions] = None,
|
|
88
|
-
) ->
|
|
89
|
+
) -> LocalFilesExportStorage:
|
|
89
90
|
"""
|
|
90
|
-
|
|
91
|
-
Create a new target storage connection to a local file directory.
|
|
92
|
-
|
|
93
|
-
For information about the required fields and prerequisites, see [Local storage](https://labelstud.io/guide/storage#Local-storage) in the Label Studio documentation.
|
|
94
|
-
|
|
95
|
-
<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>
|
|
91
|
+
Create a new local file export storage connection to store annotations.
|
|
96
92
|
|
|
97
93
|
Parameters
|
|
98
94
|
----------
|
|
@@ -119,7 +115,7 @@ class LocalClient:
|
|
|
119
115
|
|
|
120
116
|
Returns
|
|
121
117
|
-------
|
|
122
|
-
|
|
118
|
+
LocalFilesExportStorage
|
|
123
119
|
|
|
124
120
|
|
|
125
121
|
Examples
|
|
@@ -151,9 +147,9 @@ class LocalClient:
|
|
|
151
147
|
try:
|
|
152
148
|
if 200 <= _response.status_code < 300:
|
|
153
149
|
return typing.cast(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
type_=
|
|
150
|
+
LocalFilesExportStorage,
|
|
151
|
+
construct_type(
|
|
152
|
+
type_=LocalFilesExportStorage, # type: ignore
|
|
157
153
|
object_=_response.json(),
|
|
158
154
|
),
|
|
159
155
|
)
|
|
@@ -162,98 +158,13 @@ class LocalClient:
|
|
|
162
158
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
163
159
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
164
160
|
|
|
165
|
-
def validate(
|
|
166
|
-
self,
|
|
167
|
-
*,
|
|
168
|
-
id: typing.Optional[int] = OMIT,
|
|
169
|
-
title: typing.Optional[str] = OMIT,
|
|
170
|
-
description: typing.Optional[str] = OMIT,
|
|
171
|
-
project: typing.Optional[int] = OMIT,
|
|
172
|
-
path: typing.Optional[str] = OMIT,
|
|
173
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
174
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
175
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
176
|
-
) -> None:
|
|
177
|
-
"""
|
|
178
|
-
|
|
179
|
-
Validate a specific local file export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
|
|
180
|
-
|
|
181
|
-
Parameters
|
|
182
|
-
----------
|
|
183
|
-
id : typing.Optional[int]
|
|
184
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
185
|
-
|
|
186
|
-
title : typing.Optional[str]
|
|
187
|
-
Storage title
|
|
188
|
-
|
|
189
|
-
description : typing.Optional[str]
|
|
190
|
-
Storage description
|
|
191
|
-
|
|
192
|
-
project : typing.Optional[int]
|
|
193
|
-
Project ID
|
|
194
|
-
|
|
195
|
-
path : typing.Optional[str]
|
|
196
|
-
Path to local directory
|
|
197
|
-
|
|
198
|
-
regex_filter : typing.Optional[str]
|
|
199
|
-
Regex for filtering objects
|
|
200
|
-
|
|
201
|
-
use_blob_urls : typing.Optional[bool]
|
|
202
|
-
Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
203
|
-
|
|
204
|
-
request_options : typing.Optional[RequestOptions]
|
|
205
|
-
Request-specific configuration.
|
|
206
|
-
|
|
207
|
-
Returns
|
|
208
|
-
-------
|
|
209
|
-
None
|
|
210
|
-
|
|
211
|
-
Examples
|
|
212
|
-
--------
|
|
213
|
-
from label_studio_sdk import LabelStudio
|
|
214
|
-
|
|
215
|
-
client = LabelStudio(
|
|
216
|
-
api_key="YOUR_API_KEY",
|
|
217
|
-
)
|
|
218
|
-
client.export_storage.local.validate()
|
|
219
|
-
"""
|
|
220
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
221
|
-
"api/storages/export/localfiles/validate",
|
|
222
|
-
method="POST",
|
|
223
|
-
json={
|
|
224
|
-
"id": id,
|
|
225
|
-
"title": title,
|
|
226
|
-
"description": description,
|
|
227
|
-
"project": project,
|
|
228
|
-
"path": path,
|
|
229
|
-
"regex_filter": regex_filter,
|
|
230
|
-
"use_blob_urls": use_blob_urls,
|
|
231
|
-
},
|
|
232
|
-
headers={
|
|
233
|
-
"content-type": "application/json",
|
|
234
|
-
},
|
|
235
|
-
request_options=request_options,
|
|
236
|
-
omit=OMIT,
|
|
237
|
-
)
|
|
238
|
-
try:
|
|
239
|
-
if 200 <= _response.status_code < 300:
|
|
240
|
-
return
|
|
241
|
-
_response_json = _response.json()
|
|
242
|
-
except JSONDecodeError:
|
|
243
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
244
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
245
|
-
|
|
246
161
|
def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesExportStorage:
|
|
247
162
|
"""
|
|
248
|
-
|
|
249
|
-
Get a specific local file export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
250
|
-
|
|
251
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
163
|
+
Get a specific local file export storage connection.
|
|
252
164
|
|
|
253
165
|
Parameters
|
|
254
166
|
----------
|
|
255
167
|
id : int
|
|
256
|
-
A unique integer value identifying this local files export storage.
|
|
257
168
|
|
|
258
169
|
request_options : typing.Optional[RequestOptions]
|
|
259
170
|
Request-specific configuration.
|
|
@@ -283,7 +194,7 @@ class LocalClient:
|
|
|
283
194
|
if 200 <= _response.status_code < 300:
|
|
284
195
|
return typing.cast(
|
|
285
196
|
LocalFilesExportStorage,
|
|
286
|
-
|
|
197
|
+
construct_type(
|
|
287
198
|
type_=LocalFilesExportStorage, # type: ignore
|
|
288
199
|
object_=_response.json(),
|
|
289
200
|
),
|
|
@@ -295,15 +206,11 @@ class LocalClient:
|
|
|
295
206
|
|
|
296
207
|
def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
297
208
|
"""
|
|
298
|
-
|
|
299
|
-
Delete a specific local file export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
300
|
-
|
|
301
|
-
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.
|
|
209
|
+
Delete a specific local file export storage connection.
|
|
302
210
|
|
|
303
211
|
Parameters
|
|
304
212
|
----------
|
|
305
213
|
id : int
|
|
306
|
-
A unique integer value identifying this local files export storage.
|
|
307
214
|
|
|
308
215
|
request_options : typing.Optional[RequestOptions]
|
|
309
216
|
Request-specific configuration.
|
|
@@ -347,17 +254,13 @@ class LocalClient:
|
|
|
347
254
|
regex_filter: typing.Optional[str] = OMIT,
|
|
348
255
|
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
349
256
|
request_options: typing.Optional[RequestOptions] = None,
|
|
350
|
-
) ->
|
|
257
|
+
) -> LocalFilesExportStorage:
|
|
351
258
|
"""
|
|
352
|
-
|
|
353
|
-
Update a specific local file export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
354
|
-
|
|
355
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
259
|
+
Update a specific local file export storage connection.
|
|
356
260
|
|
|
357
261
|
Parameters
|
|
358
262
|
----------
|
|
359
263
|
id : int
|
|
360
|
-
A unique integer value identifying this local files export storage.
|
|
361
264
|
|
|
362
265
|
title : typing.Optional[str]
|
|
363
266
|
Storage title
|
|
@@ -382,7 +285,7 @@ class LocalClient:
|
|
|
382
285
|
|
|
383
286
|
Returns
|
|
384
287
|
-------
|
|
385
|
-
|
|
288
|
+
LocalFilesExportStorage
|
|
386
289
|
|
|
387
290
|
|
|
388
291
|
Examples
|
|
@@ -416,9 +319,9 @@ class LocalClient:
|
|
|
416
319
|
try:
|
|
417
320
|
if 200 <= _response.status_code < 300:
|
|
418
321
|
return typing.cast(
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
type_=
|
|
322
|
+
LocalFilesExportStorage,
|
|
323
|
+
construct_type(
|
|
324
|
+
type_=LocalFilesExportStorage, # type: ignore
|
|
422
325
|
object_=_response.json(),
|
|
423
326
|
),
|
|
424
327
|
)
|
|
@@ -429,12 +332,7 @@ class LocalClient:
|
|
|
429
332
|
|
|
430
333
|
def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesExportStorage:
|
|
431
334
|
"""
|
|
432
|
-
|
|
433
|
-
Sync tasks to an local file export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
434
|
-
|
|
435
|
-
Sync operations with external local file directories only go one way. They either create tasks from objects in the directory (source/import storage) or push annotations to the output directory (export/target storage). Changing something on the local file side doesn’t guarantee consistency in results.
|
|
436
|
-
|
|
437
|
-
<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>
|
|
335
|
+
Sync tasks from a local file export storage connection.
|
|
438
336
|
|
|
439
337
|
Parameters
|
|
440
338
|
----------
|
|
@@ -468,7 +366,7 @@ class LocalClient:
|
|
|
468
366
|
if 200 <= _response.status_code < 300:
|
|
469
367
|
return typing.cast(
|
|
470
368
|
LocalFilesExportStorage,
|
|
471
|
-
|
|
369
|
+
construct_type(
|
|
472
370
|
type_=LocalFilesExportStorage, # type: ignore
|
|
473
371
|
object_=_response.json(),
|
|
474
372
|
),
|
|
@@ -478,119 +376,115 @@ class LocalClient:
|
|
|
478
376
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
479
377
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
480
378
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
379
|
+
def validate(
|
|
380
|
+
self,
|
|
381
|
+
*,
|
|
382
|
+
id: typing.Optional[int] = OMIT,
|
|
383
|
+
title: typing.Optional[str] = OMIT,
|
|
384
|
+
description: typing.Optional[str] = OMIT,
|
|
385
|
+
project: typing.Optional[int] = OMIT,
|
|
386
|
+
path: typing.Optional[str] = OMIT,
|
|
387
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
388
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
389
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
390
|
+
) -> None:
|
|
489
391
|
"""
|
|
392
|
+
Validate a specific local file export storage connection.
|
|
490
393
|
|
|
491
|
-
|
|
394
|
+
Parameters
|
|
395
|
+
----------
|
|
396
|
+
id : typing.Optional[int]
|
|
397
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
492
398
|
|
|
493
|
-
|
|
399
|
+
title : typing.Optional[str]
|
|
400
|
+
Storage title
|
|
494
401
|
|
|
495
|
-
|
|
402
|
+
description : typing.Optional[str]
|
|
403
|
+
Storage description
|
|
496
404
|
|
|
497
|
-
Parameters
|
|
498
|
-
----------
|
|
499
405
|
project : typing.Optional[int]
|
|
500
406
|
Project ID
|
|
501
407
|
|
|
408
|
+
path : typing.Optional[str]
|
|
409
|
+
Path to local directory
|
|
410
|
+
|
|
411
|
+
regex_filter : typing.Optional[str]
|
|
412
|
+
Regex for filtering objects
|
|
413
|
+
|
|
414
|
+
use_blob_urls : typing.Optional[bool]
|
|
415
|
+
Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
416
|
+
|
|
502
417
|
request_options : typing.Optional[RequestOptions]
|
|
503
418
|
Request-specific configuration.
|
|
504
419
|
|
|
505
420
|
Returns
|
|
506
421
|
-------
|
|
507
|
-
|
|
508
|
-
|
|
422
|
+
None
|
|
509
423
|
|
|
510
424
|
Examples
|
|
511
425
|
--------
|
|
512
|
-
import
|
|
513
|
-
|
|
514
|
-
from label_studio_sdk import AsyncLabelStudio
|
|
426
|
+
from label_studio_sdk import LabelStudio
|
|
515
427
|
|
|
516
|
-
client =
|
|
428
|
+
client = LabelStudio(
|
|
517
429
|
api_key="YOUR_API_KEY",
|
|
518
430
|
)
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
async def main() -> None:
|
|
522
|
-
await client.export_storage.local.list()
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
asyncio.run(main())
|
|
431
|
+
client.export_storage.local.validate()
|
|
526
432
|
"""
|
|
527
|
-
_response =
|
|
528
|
-
"api/storages/export/localfiles",
|
|
529
|
-
method="
|
|
530
|
-
|
|
433
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
434
|
+
"api/storages/export/localfiles/validate",
|
|
435
|
+
method="POST",
|
|
436
|
+
json={
|
|
437
|
+
"id": id,
|
|
438
|
+
"title": title,
|
|
439
|
+
"description": description,
|
|
531
440
|
"project": project,
|
|
441
|
+
"path": path,
|
|
442
|
+
"regex_filter": regex_filter,
|
|
443
|
+
"use_blob_urls": use_blob_urls,
|
|
444
|
+
},
|
|
445
|
+
headers={
|
|
446
|
+
"content-type": "application/json",
|
|
532
447
|
},
|
|
533
448
|
request_options=request_options,
|
|
449
|
+
omit=OMIT,
|
|
534
450
|
)
|
|
535
451
|
try:
|
|
536
452
|
if 200 <= _response.status_code < 300:
|
|
537
|
-
return
|
|
538
|
-
typing.List[LocalFilesExportStorage],
|
|
539
|
-
parse_obj_as(
|
|
540
|
-
type_=typing.List[LocalFilesExportStorage], # type: ignore
|
|
541
|
-
object_=_response.json(),
|
|
542
|
-
),
|
|
543
|
-
)
|
|
453
|
+
return
|
|
544
454
|
_response_json = _response.json()
|
|
545
455
|
except JSONDecodeError:
|
|
546
456
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
547
457
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
548
458
|
|
|
549
|
-
|
|
459
|
+
|
|
460
|
+
class AsyncLocalClient:
|
|
461
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
462
|
+
self._client_wrapper = client_wrapper
|
|
463
|
+
|
|
464
|
+
async def list(
|
|
550
465
|
self,
|
|
551
466
|
*,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
project: typing.Optional[int] = OMIT,
|
|
555
|
-
path: typing.Optional[str] = OMIT,
|
|
556
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
557
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
467
|
+
ordering: typing.Optional[str] = None,
|
|
468
|
+
project: typing.Optional[int] = None,
|
|
558
469
|
request_options: typing.Optional[RequestOptions] = None,
|
|
559
|
-
) ->
|
|
470
|
+
) -> typing.List[LocalFilesExportStorage]:
|
|
560
471
|
"""
|
|
561
|
-
|
|
562
|
-
Create a new target storage connection to a local file directory.
|
|
563
|
-
|
|
564
|
-
For information about the required fields and prerequisites, see [Local storage](https://labelstud.io/guide/storage#Local-storage) in the Label Studio documentation.
|
|
565
|
-
|
|
566
|
-
<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>
|
|
472
|
+
Get a list of all local file export storage connections.
|
|
567
473
|
|
|
568
474
|
Parameters
|
|
569
475
|
----------
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
description : typing.Optional[str]
|
|
574
|
-
Storage description
|
|
476
|
+
ordering : typing.Optional[str]
|
|
477
|
+
Which field to use when ordering the results.
|
|
575
478
|
|
|
576
479
|
project : typing.Optional[int]
|
|
577
480
|
Project ID
|
|
578
481
|
|
|
579
|
-
path : typing.Optional[str]
|
|
580
|
-
Path to local directory
|
|
581
|
-
|
|
582
|
-
regex_filter : typing.Optional[str]
|
|
583
|
-
Regex for filtering objects
|
|
584
|
-
|
|
585
|
-
use_blob_urls : typing.Optional[bool]
|
|
586
|
-
Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
587
|
-
|
|
588
482
|
request_options : typing.Optional[RequestOptions]
|
|
589
483
|
Request-specific configuration.
|
|
590
484
|
|
|
591
485
|
Returns
|
|
592
486
|
-------
|
|
593
|
-
|
|
487
|
+
typing.List[LocalFilesExportStorage]
|
|
594
488
|
|
|
595
489
|
|
|
596
490
|
Examples
|
|
@@ -605,34 +499,26 @@ class AsyncLocalClient:
|
|
|
605
499
|
|
|
606
500
|
|
|
607
501
|
async def main() -> None:
|
|
608
|
-
await client.export_storage.local.
|
|
502
|
+
await client.export_storage.local.list()
|
|
609
503
|
|
|
610
504
|
|
|
611
505
|
asyncio.run(main())
|
|
612
506
|
"""
|
|
613
507
|
_response = await self._client_wrapper.httpx_client.request(
|
|
614
508
|
"api/storages/export/localfiles",
|
|
615
|
-
method="
|
|
616
|
-
|
|
617
|
-
"
|
|
618
|
-
"description": description,
|
|
509
|
+
method="GET",
|
|
510
|
+
params={
|
|
511
|
+
"ordering": ordering,
|
|
619
512
|
"project": project,
|
|
620
|
-
"path": path,
|
|
621
|
-
"regex_filter": regex_filter,
|
|
622
|
-
"use_blob_urls": use_blob_urls,
|
|
623
|
-
},
|
|
624
|
-
headers={
|
|
625
|
-
"content-type": "application/json",
|
|
626
513
|
},
|
|
627
514
|
request_options=request_options,
|
|
628
|
-
omit=OMIT,
|
|
629
515
|
)
|
|
630
516
|
try:
|
|
631
517
|
if 200 <= _response.status_code < 300:
|
|
632
518
|
return typing.cast(
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
type_=
|
|
519
|
+
typing.List[LocalFilesExportStorage],
|
|
520
|
+
construct_type(
|
|
521
|
+
type_=typing.List[LocalFilesExportStorage], # type: ignore
|
|
636
522
|
object_=_response.json(),
|
|
637
523
|
),
|
|
638
524
|
)
|
|
@@ -641,10 +527,9 @@ class AsyncLocalClient:
|
|
|
641
527
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
642
528
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
643
529
|
|
|
644
|
-
async def
|
|
530
|
+
async def create(
|
|
645
531
|
self,
|
|
646
532
|
*,
|
|
647
|
-
id: typing.Optional[int] = OMIT,
|
|
648
533
|
title: typing.Optional[str] = OMIT,
|
|
649
534
|
description: typing.Optional[str] = OMIT,
|
|
650
535
|
project: typing.Optional[int] = OMIT,
|
|
@@ -652,16 +537,12 @@ class AsyncLocalClient:
|
|
|
652
537
|
regex_filter: typing.Optional[str] = OMIT,
|
|
653
538
|
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
654
539
|
request_options: typing.Optional[RequestOptions] = None,
|
|
655
|
-
) ->
|
|
540
|
+
) -> LocalFilesExportStorage:
|
|
656
541
|
"""
|
|
657
|
-
|
|
658
|
-
Validate a specific local file export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
|
|
542
|
+
Create a new local file export storage connection to store annotations.
|
|
659
543
|
|
|
660
544
|
Parameters
|
|
661
545
|
----------
|
|
662
|
-
id : typing.Optional[int]
|
|
663
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
664
|
-
|
|
665
546
|
title : typing.Optional[str]
|
|
666
547
|
Storage title
|
|
667
548
|
|
|
@@ -685,7 +566,8 @@ class AsyncLocalClient:
|
|
|
685
566
|
|
|
686
567
|
Returns
|
|
687
568
|
-------
|
|
688
|
-
|
|
569
|
+
LocalFilesExportStorage
|
|
570
|
+
|
|
689
571
|
|
|
690
572
|
Examples
|
|
691
573
|
--------
|
|
@@ -699,16 +581,15 @@ class AsyncLocalClient:
|
|
|
699
581
|
|
|
700
582
|
|
|
701
583
|
async def main() -> None:
|
|
702
|
-
await client.export_storage.local.
|
|
584
|
+
await client.export_storage.local.create()
|
|
703
585
|
|
|
704
586
|
|
|
705
587
|
asyncio.run(main())
|
|
706
588
|
"""
|
|
707
589
|
_response = await self._client_wrapper.httpx_client.request(
|
|
708
|
-
"api/storages/export/localfiles
|
|
590
|
+
"api/storages/export/localfiles",
|
|
709
591
|
method="POST",
|
|
710
592
|
json={
|
|
711
|
-
"id": id,
|
|
712
593
|
"title": title,
|
|
713
594
|
"description": description,
|
|
714
595
|
"project": project,
|
|
@@ -724,7 +605,13 @@ class AsyncLocalClient:
|
|
|
724
605
|
)
|
|
725
606
|
try:
|
|
726
607
|
if 200 <= _response.status_code < 300:
|
|
727
|
-
return
|
|
608
|
+
return typing.cast(
|
|
609
|
+
LocalFilesExportStorage,
|
|
610
|
+
construct_type(
|
|
611
|
+
type_=LocalFilesExportStorage, # type: ignore
|
|
612
|
+
object_=_response.json(),
|
|
613
|
+
),
|
|
614
|
+
)
|
|
728
615
|
_response_json = _response.json()
|
|
729
616
|
except JSONDecodeError:
|
|
730
617
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -732,15 +619,11 @@ class AsyncLocalClient:
|
|
|
732
619
|
|
|
733
620
|
async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesExportStorage:
|
|
734
621
|
"""
|
|
735
|
-
|
|
736
|
-
Get a specific local file export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
737
|
-
|
|
738
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
622
|
+
Get a specific local file export storage connection.
|
|
739
623
|
|
|
740
624
|
Parameters
|
|
741
625
|
----------
|
|
742
626
|
id : int
|
|
743
|
-
A unique integer value identifying this local files export storage.
|
|
744
627
|
|
|
745
628
|
request_options : typing.Optional[RequestOptions]
|
|
746
629
|
Request-specific configuration.
|
|
@@ -778,7 +661,7 @@ class AsyncLocalClient:
|
|
|
778
661
|
if 200 <= _response.status_code < 300:
|
|
779
662
|
return typing.cast(
|
|
780
663
|
LocalFilesExportStorage,
|
|
781
|
-
|
|
664
|
+
construct_type(
|
|
782
665
|
type_=LocalFilesExportStorage, # type: ignore
|
|
783
666
|
object_=_response.json(),
|
|
784
667
|
),
|
|
@@ -790,15 +673,11 @@ class AsyncLocalClient:
|
|
|
790
673
|
|
|
791
674
|
async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
792
675
|
"""
|
|
793
|
-
|
|
794
|
-
Delete a specific local file export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
795
|
-
|
|
796
|
-
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.
|
|
676
|
+
Delete a specific local file export storage connection.
|
|
797
677
|
|
|
798
678
|
Parameters
|
|
799
679
|
----------
|
|
800
680
|
id : int
|
|
801
|
-
A unique integer value identifying this local files export storage.
|
|
802
681
|
|
|
803
682
|
request_options : typing.Optional[RequestOptions]
|
|
804
683
|
Request-specific configuration.
|
|
@@ -850,17 +729,13 @@ class AsyncLocalClient:
|
|
|
850
729
|
regex_filter: typing.Optional[str] = OMIT,
|
|
851
730
|
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
852
731
|
request_options: typing.Optional[RequestOptions] = None,
|
|
853
|
-
) ->
|
|
732
|
+
) -> LocalFilesExportStorage:
|
|
854
733
|
"""
|
|
855
|
-
|
|
856
|
-
Update a specific local file export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
857
|
-
|
|
858
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
734
|
+
Update a specific local file export storage connection.
|
|
859
735
|
|
|
860
736
|
Parameters
|
|
861
737
|
----------
|
|
862
738
|
id : int
|
|
863
|
-
A unique integer value identifying this local files export storage.
|
|
864
739
|
|
|
865
740
|
title : typing.Optional[str]
|
|
866
741
|
Storage title
|
|
@@ -885,7 +760,7 @@ class AsyncLocalClient:
|
|
|
885
760
|
|
|
886
761
|
Returns
|
|
887
762
|
-------
|
|
888
|
-
|
|
763
|
+
LocalFilesExportStorage
|
|
889
764
|
|
|
890
765
|
|
|
891
766
|
Examples
|
|
@@ -927,9 +802,9 @@ class AsyncLocalClient:
|
|
|
927
802
|
try:
|
|
928
803
|
if 200 <= _response.status_code < 300:
|
|
929
804
|
return typing.cast(
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
type_=
|
|
805
|
+
LocalFilesExportStorage,
|
|
806
|
+
construct_type(
|
|
807
|
+
type_=LocalFilesExportStorage, # type: ignore
|
|
933
808
|
object_=_response.json(),
|
|
934
809
|
),
|
|
935
810
|
)
|
|
@@ -942,12 +817,7 @@ class AsyncLocalClient:
|
|
|
942
817
|
self, id: int, *, request_options: typing.Optional[RequestOptions] = None
|
|
943
818
|
) -> LocalFilesExportStorage:
|
|
944
819
|
"""
|
|
945
|
-
|
|
946
|
-
Sync tasks to an local file export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
947
|
-
|
|
948
|
-
Sync operations with external local file directories only go one way. They either create tasks from objects in the directory (source/import storage) or push annotations to the output directory (export/target storage). Changing something on the local file side doesn’t guarantee consistency in results.
|
|
949
|
-
|
|
950
|
-
<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>
|
|
820
|
+
Sync tasks from a local file export storage connection.
|
|
951
821
|
|
|
952
822
|
Parameters
|
|
953
823
|
----------
|
|
@@ -989,7 +859,7 @@ class AsyncLocalClient:
|
|
|
989
859
|
if 200 <= _response.status_code < 300:
|
|
990
860
|
return typing.cast(
|
|
991
861
|
LocalFilesExportStorage,
|
|
992
|
-
|
|
862
|
+
construct_type(
|
|
993
863
|
type_=LocalFilesExportStorage, # type: ignore
|
|
994
864
|
object_=_response.json(),
|
|
995
865
|
),
|
|
@@ -998,3 +868,91 @@ class AsyncLocalClient:
|
|
|
998
868
|
except JSONDecodeError:
|
|
999
869
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1000
870
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
871
|
+
|
|
872
|
+
async def validate(
|
|
873
|
+
self,
|
|
874
|
+
*,
|
|
875
|
+
id: typing.Optional[int] = OMIT,
|
|
876
|
+
title: typing.Optional[str] = OMIT,
|
|
877
|
+
description: typing.Optional[str] = OMIT,
|
|
878
|
+
project: typing.Optional[int] = OMIT,
|
|
879
|
+
path: typing.Optional[str] = OMIT,
|
|
880
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
881
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
882
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
883
|
+
) -> None:
|
|
884
|
+
"""
|
|
885
|
+
Validate a specific local file export storage connection.
|
|
886
|
+
|
|
887
|
+
Parameters
|
|
888
|
+
----------
|
|
889
|
+
id : typing.Optional[int]
|
|
890
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
891
|
+
|
|
892
|
+
title : typing.Optional[str]
|
|
893
|
+
Storage title
|
|
894
|
+
|
|
895
|
+
description : typing.Optional[str]
|
|
896
|
+
Storage description
|
|
897
|
+
|
|
898
|
+
project : typing.Optional[int]
|
|
899
|
+
Project ID
|
|
900
|
+
|
|
901
|
+
path : typing.Optional[str]
|
|
902
|
+
Path to local directory
|
|
903
|
+
|
|
904
|
+
regex_filter : typing.Optional[str]
|
|
905
|
+
Regex for filtering objects
|
|
906
|
+
|
|
907
|
+
use_blob_urls : typing.Optional[bool]
|
|
908
|
+
Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
909
|
+
|
|
910
|
+
request_options : typing.Optional[RequestOptions]
|
|
911
|
+
Request-specific configuration.
|
|
912
|
+
|
|
913
|
+
Returns
|
|
914
|
+
-------
|
|
915
|
+
None
|
|
916
|
+
|
|
917
|
+
Examples
|
|
918
|
+
--------
|
|
919
|
+
import asyncio
|
|
920
|
+
|
|
921
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
922
|
+
|
|
923
|
+
client = AsyncLabelStudio(
|
|
924
|
+
api_key="YOUR_API_KEY",
|
|
925
|
+
)
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
async def main() -> None:
|
|
929
|
+
await client.export_storage.local.validate()
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
asyncio.run(main())
|
|
933
|
+
"""
|
|
934
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
935
|
+
"api/storages/export/localfiles/validate",
|
|
936
|
+
method="POST",
|
|
937
|
+
json={
|
|
938
|
+
"id": id,
|
|
939
|
+
"title": title,
|
|
940
|
+
"description": description,
|
|
941
|
+
"project": project,
|
|
942
|
+
"path": path,
|
|
943
|
+
"regex_filter": regex_filter,
|
|
944
|
+
"use_blob_urls": use_blob_urls,
|
|
945
|
+
},
|
|
946
|
+
headers={
|
|
947
|
+
"content-type": "application/json",
|
|
948
|
+
},
|
|
949
|
+
request_options=request_options,
|
|
950
|
+
omit=OMIT,
|
|
951
|
+
)
|
|
952
|
+
try:
|
|
953
|
+
if 200 <= _response.status_code < 300:
|
|
954
|
+
return
|
|
955
|
+
_response_json = _response.json()
|
|
956
|
+
except JSONDecodeError:
|
|
957
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
958
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|