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.redis_export_storage import RedisExportStorage
|
|
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.redis_create_response import RedisCreateResponse
|
|
11
10
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
12
|
-
from .types.redis_update_response import RedisUpdateResponse
|
|
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 RedisClient:
|
|
|
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[RedisExportStorage]:
|
|
26
28
|
"""
|
|
27
|
-
|
|
28
|
-
You can connect your Redis database to Label Studio as a source storage or target storage. Use this API request to get a list of all Redis 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 Redis 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 RedisClient:
|
|
|
57
57
|
"api/storages/export/redis",
|
|
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 RedisClient:
|
|
|
65
66
|
if 200 <= _response.status_code < 300:
|
|
66
67
|
return typing.cast(
|
|
67
68
|
typing.List[RedisExportStorage],
|
|
68
|
-
|
|
69
|
+
construct_type(
|
|
69
70
|
type_=typing.List[RedisExportStorage], # type: ignore
|
|
70
71
|
object_=_response.json(),
|
|
71
72
|
),
|
|
@@ -88,14 +89,9 @@ class RedisClient:
|
|
|
88
89
|
port: typing.Optional[str] = OMIT,
|
|
89
90
|
password: typing.Optional[str] = OMIT,
|
|
90
91
|
request_options: typing.Optional[RequestOptions] = None,
|
|
91
|
-
) ->
|
|
92
|
+
) -> RedisExportStorage:
|
|
92
93
|
"""
|
|
93
|
-
|
|
94
|
-
Create a new target storage connection to Redis.
|
|
95
|
-
|
|
96
|
-
For information about the required fields and prerequisites, see [Redis database](https://labelstud.io/guide/storage#Redis-database) in the Label Studio documentation.
|
|
97
|
-
|
|
98
|
-
<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>
|
|
94
|
+
Create a new Redis export storage connection to store annotations.
|
|
99
95
|
|
|
100
96
|
Parameters
|
|
101
97
|
----------
|
|
@@ -131,7 +127,7 @@ class RedisClient:
|
|
|
131
127
|
|
|
132
128
|
Returns
|
|
133
129
|
-------
|
|
134
|
-
|
|
130
|
+
RedisExportStorage
|
|
135
131
|
|
|
136
132
|
|
|
137
133
|
Examples
|
|
@@ -166,9 +162,9 @@ class RedisClient:
|
|
|
166
162
|
try:
|
|
167
163
|
if 200 <= _response.status_code < 300:
|
|
168
164
|
return typing.cast(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
type_=
|
|
165
|
+
RedisExportStorage,
|
|
166
|
+
construct_type(
|
|
167
|
+
type_=RedisExportStorage, # type: ignore
|
|
172
168
|
object_=_response.json(),
|
|
173
169
|
),
|
|
174
170
|
)
|
|
@@ -177,113 +173,13 @@ class RedisClient:
|
|
|
177
173
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
178
174
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
179
175
|
|
|
180
|
-
def validate(
|
|
181
|
-
self,
|
|
182
|
-
*,
|
|
183
|
-
id: typing.Optional[int] = OMIT,
|
|
184
|
-
db: typing.Optional[int] = OMIT,
|
|
185
|
-
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
186
|
-
title: typing.Optional[str] = OMIT,
|
|
187
|
-
description: typing.Optional[str] = OMIT,
|
|
188
|
-
project: typing.Optional[int] = OMIT,
|
|
189
|
-
path: typing.Optional[str] = OMIT,
|
|
190
|
-
host: typing.Optional[str] = OMIT,
|
|
191
|
-
port: typing.Optional[str] = OMIT,
|
|
192
|
-
password: typing.Optional[str] = OMIT,
|
|
193
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
194
|
-
) -> None:
|
|
195
|
-
"""
|
|
196
|
-
|
|
197
|
-
Validate a specific Redis export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
|
|
198
|
-
|
|
199
|
-
Parameters
|
|
200
|
-
----------
|
|
201
|
-
id : typing.Optional[int]
|
|
202
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
203
|
-
|
|
204
|
-
db : typing.Optional[int]
|
|
205
|
-
Database ID of database to use
|
|
206
|
-
|
|
207
|
-
can_delete_objects : typing.Optional[bool]
|
|
208
|
-
Deletion from storage enabled.
|
|
209
|
-
|
|
210
|
-
title : typing.Optional[str]
|
|
211
|
-
Storage title
|
|
212
|
-
|
|
213
|
-
description : typing.Optional[str]
|
|
214
|
-
Storage description
|
|
215
|
-
|
|
216
|
-
project : typing.Optional[int]
|
|
217
|
-
Project ID
|
|
218
|
-
|
|
219
|
-
path : typing.Optional[str]
|
|
220
|
-
Storage prefix (optional)
|
|
221
|
-
|
|
222
|
-
host : typing.Optional[str]
|
|
223
|
-
Server Host IP (optional)
|
|
224
|
-
|
|
225
|
-
port : typing.Optional[str]
|
|
226
|
-
Server Port (optional)
|
|
227
|
-
|
|
228
|
-
password : typing.Optional[str]
|
|
229
|
-
Server Password (optional)
|
|
230
|
-
|
|
231
|
-
request_options : typing.Optional[RequestOptions]
|
|
232
|
-
Request-specific configuration.
|
|
233
|
-
|
|
234
|
-
Returns
|
|
235
|
-
-------
|
|
236
|
-
None
|
|
237
|
-
|
|
238
|
-
Examples
|
|
239
|
-
--------
|
|
240
|
-
from label_studio_sdk import LabelStudio
|
|
241
|
-
|
|
242
|
-
client = LabelStudio(
|
|
243
|
-
api_key="YOUR_API_KEY",
|
|
244
|
-
)
|
|
245
|
-
client.export_storage.redis.validate()
|
|
246
|
-
"""
|
|
247
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
248
|
-
"api/storages/export/redis/validate",
|
|
249
|
-
method="POST",
|
|
250
|
-
json={
|
|
251
|
-
"id": id,
|
|
252
|
-
"db": db,
|
|
253
|
-
"can_delete_objects": can_delete_objects,
|
|
254
|
-
"title": title,
|
|
255
|
-
"description": description,
|
|
256
|
-
"project": project,
|
|
257
|
-
"path": path,
|
|
258
|
-
"host": host,
|
|
259
|
-
"port": port,
|
|
260
|
-
"password": password,
|
|
261
|
-
},
|
|
262
|
-
headers={
|
|
263
|
-
"content-type": "application/json",
|
|
264
|
-
},
|
|
265
|
-
request_options=request_options,
|
|
266
|
-
omit=OMIT,
|
|
267
|
-
)
|
|
268
|
-
try:
|
|
269
|
-
if 200 <= _response.status_code < 300:
|
|
270
|
-
return
|
|
271
|
-
_response_json = _response.json()
|
|
272
|
-
except JSONDecodeError:
|
|
273
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
274
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
275
|
-
|
|
276
176
|
def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisExportStorage:
|
|
277
177
|
"""
|
|
278
|
-
|
|
279
|
-
Get a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
280
|
-
|
|
281
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
178
|
+
Get a specific Redis export storage connection.
|
|
282
179
|
|
|
283
180
|
Parameters
|
|
284
181
|
----------
|
|
285
182
|
id : int
|
|
286
|
-
A unique integer value identifying this redis export storage.
|
|
287
183
|
|
|
288
184
|
request_options : typing.Optional[RequestOptions]
|
|
289
185
|
Request-specific configuration.
|
|
@@ -313,7 +209,7 @@ class RedisClient:
|
|
|
313
209
|
if 200 <= _response.status_code < 300:
|
|
314
210
|
return typing.cast(
|
|
315
211
|
RedisExportStorage,
|
|
316
|
-
|
|
212
|
+
construct_type(
|
|
317
213
|
type_=RedisExportStorage, # type: ignore
|
|
318
214
|
object_=_response.json(),
|
|
319
215
|
),
|
|
@@ -325,15 +221,11 @@ class RedisClient:
|
|
|
325
221
|
|
|
326
222
|
def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
327
223
|
"""
|
|
328
|
-
|
|
329
|
-
Delete a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
330
|
-
|
|
331
|
-
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.
|
|
224
|
+
Delete a specific Redis export storage connection.
|
|
332
225
|
|
|
333
226
|
Parameters
|
|
334
227
|
----------
|
|
335
228
|
id : int
|
|
336
|
-
A unique integer value identifying this redis export storage.
|
|
337
229
|
|
|
338
230
|
request_options : typing.Optional[RequestOptions]
|
|
339
231
|
Request-specific configuration.
|
|
@@ -380,17 +272,13 @@ class RedisClient:
|
|
|
380
272
|
port: typing.Optional[str] = OMIT,
|
|
381
273
|
password: typing.Optional[str] = OMIT,
|
|
382
274
|
request_options: typing.Optional[RequestOptions] = None,
|
|
383
|
-
) ->
|
|
275
|
+
) -> RedisExportStorage:
|
|
384
276
|
"""
|
|
385
|
-
|
|
386
|
-
Update a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
387
|
-
|
|
388
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
277
|
+
Update a specific Redis export storage connection.
|
|
389
278
|
|
|
390
279
|
Parameters
|
|
391
280
|
----------
|
|
392
281
|
id : int
|
|
393
|
-
A unique integer value identifying this redis export storage.
|
|
394
282
|
|
|
395
283
|
db : typing.Optional[int]
|
|
396
284
|
Database ID of database to use
|
|
@@ -424,7 +312,7 @@ class RedisClient:
|
|
|
424
312
|
|
|
425
313
|
Returns
|
|
426
314
|
-------
|
|
427
|
-
|
|
315
|
+
RedisExportStorage
|
|
428
316
|
|
|
429
317
|
|
|
430
318
|
Examples
|
|
@@ -461,9 +349,9 @@ class RedisClient:
|
|
|
461
349
|
try:
|
|
462
350
|
if 200 <= _response.status_code < 300:
|
|
463
351
|
return typing.cast(
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
type_=
|
|
352
|
+
RedisExportStorage,
|
|
353
|
+
construct_type(
|
|
354
|
+
type_=RedisExportStorage, # type: ignore
|
|
467
355
|
object_=_response.json(),
|
|
468
356
|
),
|
|
469
357
|
)
|
|
@@ -474,12 +362,7 @@ class RedisClient:
|
|
|
474
362
|
|
|
475
363
|
def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisExportStorage:
|
|
476
364
|
"""
|
|
477
|
-
|
|
478
|
-
Sync tasks to an Redis export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
479
|
-
|
|
480
|
-
Sync operations with external databases only go one way. They either create tasks from objects in the database (source/import storage) or push annotations to the output database (export/target storage). Changing something on the database side doesn’t guarantee consistency in results.
|
|
481
|
-
|
|
482
|
-
<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>
|
|
365
|
+
Sync tasks from a Redis export storage connection.
|
|
483
366
|
|
|
484
367
|
Parameters
|
|
485
368
|
----------
|
|
@@ -513,7 +396,7 @@ class RedisClient:
|
|
|
513
396
|
if 200 <= _response.status_code < 300:
|
|
514
397
|
return typing.cast(
|
|
515
398
|
RedisExportStorage,
|
|
516
|
-
|
|
399
|
+
construct_type(
|
|
517
400
|
type_=RedisExportStorage, # type: ignore
|
|
518
401
|
object_=_response.json(),
|
|
519
402
|
),
|
|
@@ -523,77 +406,10 @@ class RedisClient:
|
|
|
523
406
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
524
407
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
525
408
|
|
|
526
|
-
|
|
527
|
-
class AsyncRedisClient:
|
|
528
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
529
|
-
self._client_wrapper = client_wrapper
|
|
530
|
-
|
|
531
|
-
async def list(
|
|
532
|
-
self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
533
|
-
) -> typing.List[RedisExportStorage]:
|
|
534
|
-
"""
|
|
535
|
-
|
|
536
|
-
You can connect your Redis database to Label Studio as a source storage or target storage. Use this API request to get a list of all Redis export (target) storage connections for a specific project.
|
|
537
|
-
|
|
538
|
-
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).
|
|
539
|
-
|
|
540
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
541
|
-
|
|
542
|
-
Parameters
|
|
543
|
-
----------
|
|
544
|
-
project : typing.Optional[int]
|
|
545
|
-
Project ID
|
|
546
|
-
|
|
547
|
-
request_options : typing.Optional[RequestOptions]
|
|
548
|
-
Request-specific configuration.
|
|
549
|
-
|
|
550
|
-
Returns
|
|
551
|
-
-------
|
|
552
|
-
typing.List[RedisExportStorage]
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
Examples
|
|
556
|
-
--------
|
|
557
|
-
import asyncio
|
|
558
|
-
|
|
559
|
-
from label_studio_sdk import AsyncLabelStudio
|
|
560
|
-
|
|
561
|
-
client = AsyncLabelStudio(
|
|
562
|
-
api_key="YOUR_API_KEY",
|
|
563
|
-
)
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
async def main() -> None:
|
|
567
|
-
await client.export_storage.redis.list()
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
asyncio.run(main())
|
|
571
|
-
"""
|
|
572
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
573
|
-
"api/storages/export/redis",
|
|
574
|
-
method="GET",
|
|
575
|
-
params={
|
|
576
|
-
"project": project,
|
|
577
|
-
},
|
|
578
|
-
request_options=request_options,
|
|
579
|
-
)
|
|
580
|
-
try:
|
|
581
|
-
if 200 <= _response.status_code < 300:
|
|
582
|
-
return typing.cast(
|
|
583
|
-
typing.List[RedisExportStorage],
|
|
584
|
-
parse_obj_as(
|
|
585
|
-
type_=typing.List[RedisExportStorage], # type: ignore
|
|
586
|
-
object_=_response.json(),
|
|
587
|
-
),
|
|
588
|
-
)
|
|
589
|
-
_response_json = _response.json()
|
|
590
|
-
except JSONDecodeError:
|
|
591
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
592
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
593
|
-
|
|
594
|
-
async def create(
|
|
409
|
+
def validate(
|
|
595
410
|
self,
|
|
596
411
|
*,
|
|
412
|
+
id: typing.Optional[int] = OMIT,
|
|
597
413
|
db: typing.Optional[int] = OMIT,
|
|
598
414
|
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
599
415
|
title: typing.Optional[str] = OMIT,
|
|
@@ -604,17 +420,15 @@ class AsyncRedisClient:
|
|
|
604
420
|
port: typing.Optional[str] = OMIT,
|
|
605
421
|
password: typing.Optional[str] = OMIT,
|
|
606
422
|
request_options: typing.Optional[RequestOptions] = None,
|
|
607
|
-
) ->
|
|
423
|
+
) -> None:
|
|
608
424
|
"""
|
|
609
|
-
|
|
610
|
-
Create a new target storage connection to Redis.
|
|
611
|
-
|
|
612
|
-
For information about the required fields and prerequisites, see [Redis database](https://labelstud.io/guide/storage#Redis-database) in the Label Studio documentation.
|
|
613
|
-
|
|
614
|
-
<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>
|
|
425
|
+
Validate a specific Redis export storage connection.
|
|
615
426
|
|
|
616
427
|
Parameters
|
|
617
428
|
----------
|
|
429
|
+
id : typing.Optional[int]
|
|
430
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
431
|
+
|
|
618
432
|
db : typing.Optional[int]
|
|
619
433
|
Database ID of database to use
|
|
620
434
|
|
|
@@ -647,30 +461,22 @@ class AsyncRedisClient:
|
|
|
647
461
|
|
|
648
462
|
Returns
|
|
649
463
|
-------
|
|
650
|
-
|
|
651
|
-
|
|
464
|
+
None
|
|
652
465
|
|
|
653
466
|
Examples
|
|
654
467
|
--------
|
|
655
|
-
import
|
|
656
|
-
|
|
657
|
-
from label_studio_sdk import AsyncLabelStudio
|
|
468
|
+
from label_studio_sdk import LabelStudio
|
|
658
469
|
|
|
659
|
-
client =
|
|
470
|
+
client = LabelStudio(
|
|
660
471
|
api_key="YOUR_API_KEY",
|
|
661
472
|
)
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
async def main() -> None:
|
|
665
|
-
await client.export_storage.redis.create()
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
asyncio.run(main())
|
|
473
|
+
client.export_storage.redis.validate()
|
|
669
474
|
"""
|
|
670
|
-
_response =
|
|
671
|
-
"api/storages/export/redis",
|
|
475
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
476
|
+
"api/storages/export/redis/validate",
|
|
672
477
|
method="POST",
|
|
673
478
|
json={
|
|
479
|
+
"id": id,
|
|
674
480
|
"db": db,
|
|
675
481
|
"can_delete_objects": can_delete_objects,
|
|
676
482
|
"title": title,
|
|
@@ -687,12 +493,77 @@ class AsyncRedisClient:
|
|
|
687
493
|
request_options=request_options,
|
|
688
494
|
omit=OMIT,
|
|
689
495
|
)
|
|
496
|
+
try:
|
|
497
|
+
if 200 <= _response.status_code < 300:
|
|
498
|
+
return
|
|
499
|
+
_response_json = _response.json()
|
|
500
|
+
except JSONDecodeError:
|
|
501
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
502
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
class AsyncRedisClient:
|
|
506
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
507
|
+
self._client_wrapper = client_wrapper
|
|
508
|
+
|
|
509
|
+
async def list(
|
|
510
|
+
self,
|
|
511
|
+
*,
|
|
512
|
+
ordering: typing.Optional[str] = None,
|
|
513
|
+
project: typing.Optional[int] = None,
|
|
514
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
515
|
+
) -> typing.List[RedisExportStorage]:
|
|
516
|
+
"""
|
|
517
|
+
Get a list of all Redis export storage connections.
|
|
518
|
+
|
|
519
|
+
Parameters
|
|
520
|
+
----------
|
|
521
|
+
ordering : typing.Optional[str]
|
|
522
|
+
Which field to use when ordering the results.
|
|
523
|
+
|
|
524
|
+
project : typing.Optional[int]
|
|
525
|
+
Project ID
|
|
526
|
+
|
|
527
|
+
request_options : typing.Optional[RequestOptions]
|
|
528
|
+
Request-specific configuration.
|
|
529
|
+
|
|
530
|
+
Returns
|
|
531
|
+
-------
|
|
532
|
+
typing.List[RedisExportStorage]
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
Examples
|
|
536
|
+
--------
|
|
537
|
+
import asyncio
|
|
538
|
+
|
|
539
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
540
|
+
|
|
541
|
+
client = AsyncLabelStudio(
|
|
542
|
+
api_key="YOUR_API_KEY",
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
async def main() -> None:
|
|
547
|
+
await client.export_storage.redis.list()
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
asyncio.run(main())
|
|
551
|
+
"""
|
|
552
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
553
|
+
"api/storages/export/redis",
|
|
554
|
+
method="GET",
|
|
555
|
+
params={
|
|
556
|
+
"ordering": ordering,
|
|
557
|
+
"project": project,
|
|
558
|
+
},
|
|
559
|
+
request_options=request_options,
|
|
560
|
+
)
|
|
690
561
|
try:
|
|
691
562
|
if 200 <= _response.status_code < 300:
|
|
692
563
|
return typing.cast(
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
type_=
|
|
564
|
+
typing.List[RedisExportStorage],
|
|
565
|
+
construct_type(
|
|
566
|
+
type_=typing.List[RedisExportStorage], # type: ignore
|
|
696
567
|
object_=_response.json(),
|
|
697
568
|
),
|
|
698
569
|
)
|
|
@@ -701,10 +572,9 @@ class AsyncRedisClient:
|
|
|
701
572
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
702
573
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
703
574
|
|
|
704
|
-
async def
|
|
575
|
+
async def create(
|
|
705
576
|
self,
|
|
706
577
|
*,
|
|
707
|
-
id: typing.Optional[int] = OMIT,
|
|
708
578
|
db: typing.Optional[int] = OMIT,
|
|
709
579
|
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
710
580
|
title: typing.Optional[str] = OMIT,
|
|
@@ -715,16 +585,12 @@ class AsyncRedisClient:
|
|
|
715
585
|
port: typing.Optional[str] = OMIT,
|
|
716
586
|
password: typing.Optional[str] = OMIT,
|
|
717
587
|
request_options: typing.Optional[RequestOptions] = None,
|
|
718
|
-
) ->
|
|
588
|
+
) -> RedisExportStorage:
|
|
719
589
|
"""
|
|
720
|
-
|
|
721
|
-
Validate a specific Redis export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
|
|
590
|
+
Create a new Redis export storage connection to store annotations.
|
|
722
591
|
|
|
723
592
|
Parameters
|
|
724
593
|
----------
|
|
725
|
-
id : typing.Optional[int]
|
|
726
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
727
|
-
|
|
728
594
|
db : typing.Optional[int]
|
|
729
595
|
Database ID of database to use
|
|
730
596
|
|
|
@@ -757,7 +623,8 @@ class AsyncRedisClient:
|
|
|
757
623
|
|
|
758
624
|
Returns
|
|
759
625
|
-------
|
|
760
|
-
|
|
626
|
+
RedisExportStorage
|
|
627
|
+
|
|
761
628
|
|
|
762
629
|
Examples
|
|
763
630
|
--------
|
|
@@ -771,16 +638,15 @@ class AsyncRedisClient:
|
|
|
771
638
|
|
|
772
639
|
|
|
773
640
|
async def main() -> None:
|
|
774
|
-
await client.export_storage.redis.
|
|
641
|
+
await client.export_storage.redis.create()
|
|
775
642
|
|
|
776
643
|
|
|
777
644
|
asyncio.run(main())
|
|
778
645
|
"""
|
|
779
646
|
_response = await self._client_wrapper.httpx_client.request(
|
|
780
|
-
"api/storages/export/redis
|
|
647
|
+
"api/storages/export/redis",
|
|
781
648
|
method="POST",
|
|
782
649
|
json={
|
|
783
|
-
"id": id,
|
|
784
650
|
"db": db,
|
|
785
651
|
"can_delete_objects": can_delete_objects,
|
|
786
652
|
"title": title,
|
|
@@ -799,7 +665,13 @@ class AsyncRedisClient:
|
|
|
799
665
|
)
|
|
800
666
|
try:
|
|
801
667
|
if 200 <= _response.status_code < 300:
|
|
802
|
-
return
|
|
668
|
+
return typing.cast(
|
|
669
|
+
RedisExportStorage,
|
|
670
|
+
construct_type(
|
|
671
|
+
type_=RedisExportStorage, # type: ignore
|
|
672
|
+
object_=_response.json(),
|
|
673
|
+
),
|
|
674
|
+
)
|
|
803
675
|
_response_json = _response.json()
|
|
804
676
|
except JSONDecodeError:
|
|
805
677
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -807,15 +679,11 @@ class AsyncRedisClient:
|
|
|
807
679
|
|
|
808
680
|
async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisExportStorage:
|
|
809
681
|
"""
|
|
810
|
-
|
|
811
|
-
Get a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
812
|
-
|
|
813
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
682
|
+
Get a specific Redis export storage connection.
|
|
814
683
|
|
|
815
684
|
Parameters
|
|
816
685
|
----------
|
|
817
686
|
id : int
|
|
818
|
-
A unique integer value identifying this redis export storage.
|
|
819
687
|
|
|
820
688
|
request_options : typing.Optional[RequestOptions]
|
|
821
689
|
Request-specific configuration.
|
|
@@ -853,7 +721,7 @@ class AsyncRedisClient:
|
|
|
853
721
|
if 200 <= _response.status_code < 300:
|
|
854
722
|
return typing.cast(
|
|
855
723
|
RedisExportStorage,
|
|
856
|
-
|
|
724
|
+
construct_type(
|
|
857
725
|
type_=RedisExportStorage, # type: ignore
|
|
858
726
|
object_=_response.json(),
|
|
859
727
|
),
|
|
@@ -865,15 +733,11 @@ class AsyncRedisClient:
|
|
|
865
733
|
|
|
866
734
|
async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
867
735
|
"""
|
|
868
|
-
|
|
869
|
-
Delete a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
870
|
-
|
|
871
|
-
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.
|
|
736
|
+
Delete a specific Redis export storage connection.
|
|
872
737
|
|
|
873
738
|
Parameters
|
|
874
739
|
----------
|
|
875
740
|
id : int
|
|
876
|
-
A unique integer value identifying this redis export storage.
|
|
877
741
|
|
|
878
742
|
request_options : typing.Optional[RequestOptions]
|
|
879
743
|
Request-specific configuration.
|
|
@@ -928,17 +792,13 @@ class AsyncRedisClient:
|
|
|
928
792
|
port: typing.Optional[str] = OMIT,
|
|
929
793
|
password: typing.Optional[str] = OMIT,
|
|
930
794
|
request_options: typing.Optional[RequestOptions] = None,
|
|
931
|
-
) ->
|
|
795
|
+
) -> RedisExportStorage:
|
|
932
796
|
"""
|
|
933
|
-
|
|
934
|
-
Update a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
935
|
-
|
|
936
|
-
For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
|
|
797
|
+
Update a specific Redis export storage connection.
|
|
937
798
|
|
|
938
799
|
Parameters
|
|
939
800
|
----------
|
|
940
801
|
id : int
|
|
941
|
-
A unique integer value identifying this redis export storage.
|
|
942
802
|
|
|
943
803
|
db : typing.Optional[int]
|
|
944
804
|
Database ID of database to use
|
|
@@ -972,7 +832,7 @@ class AsyncRedisClient:
|
|
|
972
832
|
|
|
973
833
|
Returns
|
|
974
834
|
-------
|
|
975
|
-
|
|
835
|
+
RedisExportStorage
|
|
976
836
|
|
|
977
837
|
|
|
978
838
|
Examples
|
|
@@ -1017,9 +877,9 @@ class AsyncRedisClient:
|
|
|
1017
877
|
try:
|
|
1018
878
|
if 200 <= _response.status_code < 300:
|
|
1019
879
|
return typing.cast(
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
type_=
|
|
880
|
+
RedisExportStorage,
|
|
881
|
+
construct_type(
|
|
882
|
+
type_=RedisExportStorage, # type: ignore
|
|
1023
883
|
object_=_response.json(),
|
|
1024
884
|
),
|
|
1025
885
|
)
|
|
@@ -1030,12 +890,7 @@ class AsyncRedisClient:
|
|
|
1030
890
|
|
|
1031
891
|
async def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisExportStorage:
|
|
1032
892
|
"""
|
|
1033
|
-
|
|
1034
|
-
Sync tasks to an Redis export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
|
|
1035
|
-
|
|
1036
|
-
Sync operations with external databases only go one way. They either create tasks from objects in the database (source/import storage) or push annotations to the output database (export/target storage). Changing something on the database side doesn’t guarantee consistency in results.
|
|
1037
|
-
|
|
1038
|
-
<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>
|
|
893
|
+
Sync tasks from a Redis export storage connection.
|
|
1039
894
|
|
|
1040
895
|
Parameters
|
|
1041
896
|
----------
|
|
@@ -1077,7 +932,7 @@ class AsyncRedisClient:
|
|
|
1077
932
|
if 200 <= _response.status_code < 300:
|
|
1078
933
|
return typing.cast(
|
|
1079
934
|
RedisExportStorage,
|
|
1080
|
-
|
|
935
|
+
construct_type(
|
|
1081
936
|
type_=RedisExportStorage, # type: ignore
|
|
1082
937
|
object_=_response.json(),
|
|
1083
938
|
),
|
|
@@ -1086,3 +941,106 @@ class AsyncRedisClient:
|
|
|
1086
941
|
except JSONDecodeError:
|
|
1087
942
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1088
943
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
944
|
+
|
|
945
|
+
async def validate(
|
|
946
|
+
self,
|
|
947
|
+
*,
|
|
948
|
+
id: typing.Optional[int] = OMIT,
|
|
949
|
+
db: typing.Optional[int] = OMIT,
|
|
950
|
+
can_delete_objects: typing.Optional[bool] = OMIT,
|
|
951
|
+
title: typing.Optional[str] = OMIT,
|
|
952
|
+
description: typing.Optional[str] = OMIT,
|
|
953
|
+
project: typing.Optional[int] = OMIT,
|
|
954
|
+
path: typing.Optional[str] = OMIT,
|
|
955
|
+
host: typing.Optional[str] = OMIT,
|
|
956
|
+
port: typing.Optional[str] = OMIT,
|
|
957
|
+
password: typing.Optional[str] = OMIT,
|
|
958
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
959
|
+
) -> None:
|
|
960
|
+
"""
|
|
961
|
+
Validate a specific Redis export storage connection.
|
|
962
|
+
|
|
963
|
+
Parameters
|
|
964
|
+
----------
|
|
965
|
+
id : typing.Optional[int]
|
|
966
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
967
|
+
|
|
968
|
+
db : typing.Optional[int]
|
|
969
|
+
Database ID of database to use
|
|
970
|
+
|
|
971
|
+
can_delete_objects : typing.Optional[bool]
|
|
972
|
+
Deletion from storage enabled.
|
|
973
|
+
|
|
974
|
+
title : typing.Optional[str]
|
|
975
|
+
Storage title
|
|
976
|
+
|
|
977
|
+
description : typing.Optional[str]
|
|
978
|
+
Storage description
|
|
979
|
+
|
|
980
|
+
project : typing.Optional[int]
|
|
981
|
+
Project ID
|
|
982
|
+
|
|
983
|
+
path : typing.Optional[str]
|
|
984
|
+
Storage prefix (optional)
|
|
985
|
+
|
|
986
|
+
host : typing.Optional[str]
|
|
987
|
+
Server Host IP (optional)
|
|
988
|
+
|
|
989
|
+
port : typing.Optional[str]
|
|
990
|
+
Server Port (optional)
|
|
991
|
+
|
|
992
|
+
password : typing.Optional[str]
|
|
993
|
+
Server Password (optional)
|
|
994
|
+
|
|
995
|
+
request_options : typing.Optional[RequestOptions]
|
|
996
|
+
Request-specific configuration.
|
|
997
|
+
|
|
998
|
+
Returns
|
|
999
|
+
-------
|
|
1000
|
+
None
|
|
1001
|
+
|
|
1002
|
+
Examples
|
|
1003
|
+
--------
|
|
1004
|
+
import asyncio
|
|
1005
|
+
|
|
1006
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
1007
|
+
|
|
1008
|
+
client = AsyncLabelStudio(
|
|
1009
|
+
api_key="YOUR_API_KEY",
|
|
1010
|
+
)
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
async def main() -> None:
|
|
1014
|
+
await client.export_storage.redis.validate()
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
asyncio.run(main())
|
|
1018
|
+
"""
|
|
1019
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1020
|
+
"api/storages/export/redis/validate",
|
|
1021
|
+
method="POST",
|
|
1022
|
+
json={
|
|
1023
|
+
"id": id,
|
|
1024
|
+
"db": db,
|
|
1025
|
+
"can_delete_objects": can_delete_objects,
|
|
1026
|
+
"title": title,
|
|
1027
|
+
"description": description,
|
|
1028
|
+
"project": project,
|
|
1029
|
+
"path": path,
|
|
1030
|
+
"host": host,
|
|
1031
|
+
"port": port,
|
|
1032
|
+
"password": password,
|
|
1033
|
+
},
|
|
1034
|
+
headers={
|
|
1035
|
+
"content-type": "application/json",
|
|
1036
|
+
},
|
|
1037
|
+
request_options=request_options,
|
|
1038
|
+
omit=OMIT,
|
|
1039
|
+
)
|
|
1040
|
+
try:
|
|
1041
|
+
if 200 <= _response.status_code < 300:
|
|
1042
|
+
return
|
|
1043
|
+
_response_json = _response.json()
|
|
1044
|
+
except JSONDecodeError:
|
|
1045
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1046
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|