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.

Files changed (410) hide show
  1. label_studio_sdk/__init__.py +325 -180
  2. label_studio_sdk/actions/__init__.py +4 -0
  3. label_studio_sdk/actions/client.py +46 -10
  4. label_studio_sdk/actions/types/__init__.py +4 -0
  5. label_studio_sdk/actions/types/actions_create_request_filters.py +2 -2
  6. label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +2 -2
  7. label_studio_sdk/actions/types/actions_create_request_id.py +7 -7
  8. label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +2 -2
  9. label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +2 -2
  10. label_studio_sdk/actions/types/actions_list_response_item.py +25 -0
  11. label_studio_sdk/actions/types/actions_list_response_item_dialog.py +22 -0
  12. label_studio_sdk/annotations/__init__.py +2 -2
  13. label_studio_sdk/annotations/client.py +379 -243
  14. label_studio_sdk/annotations/types/__init__.py +4 -2
  15. label_studio_sdk/annotations/types/annotation_bulk_serializer_with_selected_items_request_last_action.py +7 -0
  16. label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +8 -5
  17. label_studio_sdk/base_client.py +28 -24
  18. label_studio_sdk/comments/client.py +378 -140
  19. label_studio_sdk/converter/README.md +207 -0
  20. label_studio_sdk/converter/imports/coco.py +132 -23
  21. label_studio_sdk/core/__init__.py +4 -0
  22. label_studio_sdk/core/unchecked_base_model.py +305 -0
  23. label_studio_sdk/environment.py +1 -1
  24. label_studio_sdk/errors/__init__.py +10 -1
  25. label_studio_sdk/errors/forbidden_error.py +9 -0
  26. label_studio_sdk/errors/method_not_allowed_error.py +9 -0
  27. label_studio_sdk/export_storage/__init__.py +1 -24
  28. label_studio_sdk/export_storage/azure/__init__.py +0 -3
  29. label_studio_sdk/export_storage/azure/client.py +231 -273
  30. label_studio_sdk/export_storage/client.py +5 -5
  31. label_studio_sdk/export_storage/gcs/__init__.py +0 -3
  32. label_studio_sdk/export_storage/gcs/client.py +231 -273
  33. label_studio_sdk/export_storage/local/__init__.py +0 -3
  34. label_studio_sdk/export_storage/local/client.py +211 -253
  35. label_studio_sdk/export_storage/redis/__init__.py +0 -3
  36. label_studio_sdk/export_storage/redis/client.py +239 -281
  37. label_studio_sdk/export_storage/s3/__init__.py +0 -3
  38. label_studio_sdk/export_storage/s3/client.py +254 -296
  39. label_studio_sdk/export_storage/s3s/client.py +694 -210
  40. label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +2 -2
  41. label_studio_sdk/files/client.py +52 -71
  42. label_studio_sdk/import_storage/__init__.py +1 -24
  43. label_studio_sdk/import_storage/azure/__init__.py +0 -3
  44. label_studio_sdk/import_storage/azure/client.py +249 -299
  45. label_studio_sdk/import_storage/client.py +5 -5
  46. label_studio_sdk/import_storage/gcs/__init__.py +0 -3
  47. label_studio_sdk/import_storage/gcs/client.py +249 -299
  48. label_studio_sdk/import_storage/local/__init__.py +0 -3
  49. label_studio_sdk/import_storage/local/client.py +211 -257
  50. label_studio_sdk/import_storage/redis/__init__.py +0 -3
  51. label_studio_sdk/import_storage/redis/client.py +239 -285
  52. label_studio_sdk/import_storage/s3/__init__.py +0 -3
  53. label_studio_sdk/import_storage/s3/client.py +274 -324
  54. label_studio_sdk/import_storage/s3s/client.py +728 -434
  55. label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +2 -2
  56. label_studio_sdk/jwt_settings/client.py +56 -58
  57. label_studio_sdk/label_interface/control_tags.py +48 -8
  58. label_studio_sdk/label_interface/interface.py +261 -56
  59. label_studio_sdk/ml/__init__.py +2 -16
  60. label_studio_sdk/ml/client.py +196 -179
  61. label_studio_sdk/ml/types/__init__.py +2 -12
  62. label_studio_sdk/ml/types/ml_list_model_versions_response.py +20 -0
  63. label_studio_sdk/model_providers/__init__.py +3 -0
  64. label_studio_sdk/model_providers/client.py +280 -228
  65. label_studio_sdk/model_providers/types/__init__.py +5 -0
  66. label_studio_sdk/{prompts/types/prompts_batch_predictions_response.py → model_providers/types/model_providers_list_model_provider_choices_response.py} +3 -3
  67. label_studio_sdk/organizations/__init__.py +5 -0
  68. label_studio_sdk/organizations/client.py +331 -0
  69. label_studio_sdk/organizations/members/__init__.py +2 -0
  70. label_studio_sdk/organizations/members/client.py +290 -0
  71. label_studio_sdk/predictions/client.py +29 -77
  72. label_studio_sdk/projects/__init__.py +18 -9
  73. label_studio_sdk/projects/client.py +905 -414
  74. label_studio_sdk/projects/exports/__init__.py +2 -2
  75. label_studio_sdk/projects/exports/client.py +336 -396
  76. label_studio_sdk/projects/exports/client_ext.py +30 -30
  77. label_studio_sdk/projects/exports/types/__init__.py +1 -2
  78. label_studio_sdk/projects/exports/types/exports_convert_response.py +5 -9
  79. label_studio_sdk/projects/pauses/client.py +114 -105
  80. label_studio_sdk/projects/stats/__init__.py +5 -0
  81. label_studio_sdk/projects/stats/client.py +175 -0
  82. label_studio_sdk/projects/stats/types/__init__.py +8 -0
  83. label_studio_sdk/projects/stats/types/stats_iaa_response.py +44 -0
  84. label_studio_sdk/projects/stats/types/stats_iaa_response_common_tasks.py +7 -0
  85. label_studio_sdk/projects/stats/types/stats_iaa_response_iaa.py +5 -0
  86. label_studio_sdk/{types/base_task_file_upload.py → projects/stats/types/stats_iaa_response_std.py} +1 -1
  87. label_studio_sdk/projects/types/__init__.py +10 -6
  88. label_studio_sdk/projects/types/lse_project_create_request_sampling.py +7 -0
  89. label_studio_sdk/projects/types/lse_project_create_request_skip_queue.py +7 -0
  90. label_studio_sdk/projects/types/patched_lse_project_update_request_sampling.py +7 -0
  91. label_studio_sdk/projects/types/patched_lse_project_update_request_skip_queue.py +7 -0
  92. label_studio_sdk/{prompts/types/prompts_batch_failed_predictions_response.py → projects/types/projects_duplicate_response.py} +8 -5
  93. label_studio_sdk/projects/types/projects_import_tasks_response.py +2 -2
  94. label_studio_sdk/projects/types/projects_list_request_filter.py +1 -1
  95. label_studio_sdk/prompts/__init__.py +4 -10
  96. label_studio_sdk/prompts/client.py +511 -442
  97. label_studio_sdk/prompts/indicators/__init__.py +3 -0
  98. label_studio_sdk/prompts/indicators/client.py +47 -49
  99. label_studio_sdk/prompts/indicators/types/__init__.py +5 -0
  100. label_studio_sdk/{types/key_indicator_value.py → prompts/indicators/types/indicators_list_response_item.py} +3 -3
  101. label_studio_sdk/prompts/runs/client.py +113 -135
  102. label_studio_sdk/prompts/types/__init__.py +2 -12
  103. label_studio_sdk/prompts/types/prompts_compatible_projects_request_project_type.py +7 -0
  104. label_studio_sdk/prompts/versions/client.py +372 -312
  105. label_studio_sdk/tasks/__init__.py +2 -2
  106. label_studio_sdk/tasks/client.py +514 -213
  107. label_studio_sdk/tasks/types/__init__.py +1 -2
  108. label_studio_sdk/tokens/client.py +160 -152
  109. label_studio_sdk/tokens/client_ext.py +3 -3
  110. label_studio_sdk/types/__init__.py +258 -142
  111. label_studio_sdk/{webhooks/types/webhooks_update_request_actions_item.py → types/actions_enum.py} +4 -1
  112. label_studio_sdk/types/all_roles_project_list.py +197 -0
  113. label_studio_sdk/types/all_roles_project_list_sampling.py +7 -0
  114. label_studio_sdk/types/all_roles_project_list_skip_queue.py +7 -0
  115. label_studio_sdk/types/annotated_enum.py +5 -0
  116. label_studio_sdk/types/annotation.py +24 -10
  117. label_studio_sdk/types/annotation_last_action.py +3 -15
  118. label_studio_sdk/types/{annotations_dm_field.py → annotation_request.py} +21 -30
  119. label_studio_sdk/types/annotation_request_last_action.py +7 -0
  120. label_studio_sdk/types/assignment_settings.py +31 -0
  121. label_studio_sdk/types/assignment_settings_label_stream_task_distribution.py +7 -0
  122. label_studio_sdk/types/assignment_settings_request.py +32 -0
  123. label_studio_sdk/types/assignment_settings_request_label_stream_task_distribution.py +7 -0
  124. label_studio_sdk/types/{key_indicators_item_additional_kpis_item.py → associated_project.py} +9 -6
  125. label_studio_sdk/types/auth_method_enum.py +5 -0
  126. label_studio_sdk/types/azure_blob_export_storage.py +8 -12
  127. label_studio_sdk/types/azure_blob_import_storage.py +8 -12
  128. label_studio_sdk/types/{prompt_associated_projects_item_id.py → batch_failed_predictions.py} +4 -4
  129. label_studio_sdk/types/{access_token_response.py → batch_predictions.py} +6 -8
  130. label_studio_sdk/types/blank_enum.py +5 -0
  131. label_studio_sdk/types/{key_indicators_item_extra_kpis_item.py → blueprint_list.py} +12 -6
  132. label_studio_sdk/types/budget_reset_period_enum.py +5 -0
  133. label_studio_sdk/types/child_filter.py +44 -0
  134. label_studio_sdk/types/comment.py +39 -14
  135. label_studio_sdk/types/comment_request.py +32 -0
  136. label_studio_sdk/types/comment_serializer_with_expanded_user.py +53 -0
  137. label_studio_sdk/types/converted_format.py +5 -5
  138. label_studio_sdk/types/{api_token_response.py → converted_format_request.py} +8 -15
  139. label_studio_sdk/types/custom_scripts_editable_by_enum.py +5 -0
  140. label_studio_sdk/types/default_role_enum.py +5 -0
  141. label_studio_sdk/types/edition_enum.py +5 -0
  142. label_studio_sdk/types/export.py +7 -7
  143. label_studio_sdk/types/file_upload.py +5 -5
  144. label_studio_sdk/types/filter.py +9 -6
  145. label_studio_sdk/types/filter_group.py +3 -3
  146. label_studio_sdk/types/finished_enum.py +5 -0
  147. label_studio_sdk/types/gcs_export_storage.py +8 -12
  148. label_studio_sdk/types/gcs_import_storage.py +8 -12
  149. label_studio_sdk/types/{rotate_token_response.py → hotkeys.py} +5 -8
  150. label_studio_sdk/types/{base_task.py → import_api_request.py} +11 -34
  151. label_studio_sdk/types/inference_run_cost_estimate.py +2 -2
  152. label_studio_sdk/types/label_stream_task_distribution_enum.py +5 -0
  153. label_studio_sdk/types/{annotations_dm_field_last_action.py → last_action_enum.py} +1 -1
  154. label_studio_sdk/types/local_files_export_storage.py +8 -12
  155. label_studio_sdk/types/local_files_import_storage.py +8 -12
  156. label_studio_sdk/types/{annotation_filter_options.py → lse_annotation_filter_options.py} +12 -2
  157. label_studio_sdk/types/lse_annotation_filter_options_request.py +42 -0
  158. label_studio_sdk/types/lse_annotation_filter_options_request_reviewed.py +7 -0
  159. label_studio_sdk/types/lse_annotation_filter_options_reviewed.py +7 -0
  160. label_studio_sdk/types/{export_snapshot.py → lse_export_create.py} +11 -11
  161. label_studio_sdk/types/lse_fields.py +49 -0
  162. label_studio_sdk/types/lse_fields_onboarding_state.py +8 -0
  163. label_studio_sdk/types/lse_fields_trial_role.py +8 -0
  164. label_studio_sdk/types/lse_key_indicator_value.py +35 -0
  165. label_studio_sdk/types/lse_organization.py +57 -0
  166. label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +7 -0
  167. label_studio_sdk/types/lse_project_create.py +196 -0
  168. label_studio_sdk/types/lse_project_create_sampling.py +7 -0
  169. label_studio_sdk/types/lse_project_create_skip_queue.py +7 -0
  170. label_studio_sdk/types/lse_project_update.py +215 -0
  171. label_studio_sdk/types/lse_project_update_sampling.py +7 -0
  172. label_studio_sdk/types/lse_project_update_skip_queue.py +7 -0
  173. label_studio_sdk/types/lse_s3export_storage.py +134 -0
  174. label_studio_sdk/{import_storage/s3/types/s3create_response.py → types/lse_s3export_storage_request.py} +47 -21
  175. label_studio_sdk/{import_storage/s3/types/s3update_response.py → types/lse_s3import_storage.py} +60 -21
  176. label_studio_sdk/types/{s3s_import_storage.py → lse_s3import_storage_request.py} +32 -21
  177. label_studio_sdk/types/lse_task.py +117 -0
  178. label_studio_sdk/types/{data_manager_task_serializer_drafts_item.py → lse_task_drafts_item.py} +2 -2
  179. label_studio_sdk/types/lse_task_filter_options.py +63 -0
  180. label_studio_sdk/types/lse_task_filter_options_annotated.py +7 -0
  181. label_studio_sdk/types/lse_task_filter_options_finished.py +7 -0
  182. label_studio_sdk/types/lse_task_filter_options_request.py +63 -0
  183. label_studio_sdk/types/lse_task_filter_options_request_annotated.py +7 -0
  184. label_studio_sdk/types/lse_task_filter_options_request_finished.py +7 -0
  185. label_studio_sdk/types/lse_task_filter_options_request_reviewed.py +7 -0
  186. label_studio_sdk/types/lse_task_filter_options_request_skipped.py +7 -0
  187. label_studio_sdk/types/lse_task_filter_options_reviewed.py +7 -0
  188. label_studio_sdk/types/lse_task_filter_options_skipped.py +7 -0
  189. label_studio_sdk/types/{data_manager_task_serializer_predictions_item.py → lse_task_predictions_item.py} +4 -5
  190. label_studio_sdk/types/lse_task_serializer_for_annotators.py +54 -0
  191. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +22 -0
  192. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +28 -0
  193. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +117 -0
  194. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +22 -0
  195. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +28 -0
  196. label_studio_sdk/types/lse_user.py +49 -0
  197. label_studio_sdk/types/{base_user.py → lse_user_api.py} +17 -6
  198. label_studio_sdk/types/lseapi_token_create.py +21 -0
  199. label_studio_sdk/types/lseapi_token_list.py +21 -0
  200. label_studio_sdk/types/lsejwt_settings.py +32 -0
  201. label_studio_sdk/types/maybe_expanded_comment.py +7 -0
  202. label_studio_sdk/types/ml_backend.py +16 -17
  203. label_studio_sdk/types/mode_enum.py +5 -0
  204. label_studio_sdk/types/model_interface.py +44 -0
  205. label_studio_sdk/types/model_interface_request.py +40 -0
  206. label_studio_sdk/types/model_interface_serializer_get.py +45 -0
  207. label_studio_sdk/types/model_provider_connection.py +48 -17
  208. label_studio_sdk/types/model_provider_connection_budget_reset_period.py +3 -1
  209. label_studio_sdk/types/model_provider_connection_request.py +71 -0
  210. label_studio_sdk/types/model_run.py +40 -0
  211. label_studio_sdk/types/{inference_run_status.py → model_run_status_enum.py} +1 -1
  212. label_studio_sdk/types/null_enum.py +3 -0
  213. label_studio_sdk/types/onboarding_state_enum.py +7 -0
  214. label_studio_sdk/types/organization_billing.py +20 -0
  215. label_studio_sdk/types/organization_id.py +28 -0
  216. label_studio_sdk/types/organization_invite.py +20 -0
  217. label_studio_sdk/types/organization_member.py +37 -0
  218. label_studio_sdk/types/organization_membership.py +24 -0
  219. label_studio_sdk/{projects/types/projects_list_response.py → types/paginated_all_roles_project_list_list.py} +5 -5
  220. label_studio_sdk/types/{jwt_settings_response.py → paginated_role_based_task_list.py} +11 -9
  221. label_studio_sdk/types/pause.py +55 -14
  222. label_studio_sdk/types/pause_request.py +41 -0
  223. label_studio_sdk/types/prediction.py +7 -11
  224. label_studio_sdk/types/prediction_request.py +56 -0
  225. label_studio_sdk/types/project.py +32 -39
  226. label_studio_sdk/types/project_import.py +12 -13
  227. label_studio_sdk/types/project_label_config.py +2 -2
  228. label_studio_sdk/types/project_label_config_request.py +22 -0
  229. label_studio_sdk/types/project_sampling.py +3 -3
  230. label_studio_sdk/types/project_skip_queue.py +3 -1
  231. label_studio_sdk/types/project_subset_enum.py +5 -0
  232. label_studio_sdk/types/{prompt_version_provider.py → provider_enum.py} +1 -1
  233. label_studio_sdk/types/reason_enum.py +7 -0
  234. label_studio_sdk/types/redis_export_storage.py +8 -12
  235. label_studio_sdk/types/redis_import_storage.py +8 -12
  236. label_studio_sdk/types/refined_prompt_response.py +5 -6
  237. label_studio_sdk/types/requeue_rejected_tasks_mode_enum.py +5 -0
  238. label_studio_sdk/types/review_criteria_enum.py +5 -0
  239. label_studio_sdk/types/review_settings.py +80 -0
  240. label_studio_sdk/types/review_settings_request.py +80 -0
  241. label_studio_sdk/types/review_settings_request_requeue_rejected_tasks_mode.py +8 -0
  242. label_studio_sdk/types/review_settings_request_review_criteria.py +7 -0
  243. label_studio_sdk/types/review_settings_requeue_rejected_tasks_mode.py +8 -0
  244. label_studio_sdk/types/review_settings_review_criteria.py +7 -0
  245. label_studio_sdk/types/reviewed_enum.py +5 -0
  246. label_studio_sdk/types/role_based_task.py +8 -0
  247. label_studio_sdk/types/s3export_storage.py +8 -12
  248. label_studio_sdk/types/s3import_storage.py +8 -12
  249. label_studio_sdk/types/sampling_enum.py +7 -0
  250. label_studio_sdk/types/scope_enum.py +5 -0
  251. label_studio_sdk/types/selected_items_request.py +23 -0
  252. label_studio_sdk/types/serialization_option.py +2 -6
  253. label_studio_sdk/types/serialization_option_request.py +22 -0
  254. label_studio_sdk/types/serialization_options.py +17 -5
  255. label_studio_sdk/types/serialization_options_request.py +47 -0
  256. label_studio_sdk/types/skill_name_enum.py +5 -0
  257. label_studio_sdk/types/skip_queue_enum.py +5 -0
  258. label_studio_sdk/types/skipped_enum.py +5 -0
  259. label_studio_sdk/types/state_enum.py +5 -0
  260. label_studio_sdk/types/status7bf_enum.py +5 -0
  261. label_studio_sdk/types/{azure_blob_import_storage_status.py → status_c5a_enum.py} +2 -2
  262. label_studio_sdk/types/third_party_model_version.py +65 -0
  263. label_studio_sdk/types/third_party_model_version_request.py +54 -0
  264. label_studio_sdk/types/token_refresh_response.py +19 -0
  265. label_studio_sdk/types/token_rotate_response.py +19 -0
  266. label_studio_sdk/types/trial_role_enum.py +16 -0
  267. label_studio_sdk/types/user_simple.py +8 -5
  268. label_studio_sdk/types/user_simple_request.py +28 -0
  269. label_studio_sdk/types/version_response.py +49 -0
  270. label_studio_sdk/types/view.py +8 -15
  271. label_studio_sdk/types/webhook.py +9 -13
  272. label_studio_sdk/types/webhook_serializer_for_update.py +15 -13
  273. label_studio_sdk/types/workspace.py +14 -34
  274. label_studio_sdk/types/workspace_member_create.py +27 -0
  275. label_studio_sdk/types/workspace_member_list.py +24 -0
  276. label_studio_sdk/users/client.py +604 -87
  277. label_studio_sdk/users/types/users_get_token_response.py +4 -11
  278. label_studio_sdk/users/types/users_reset_token_response.py +4 -11
  279. label_studio_sdk/versions/__init__.py +0 -3
  280. label_studio_sdk/versions/client.py +14 -14
  281. label_studio_sdk/views/client.py +227 -141
  282. label_studio_sdk/views/types/views_create_request_data.py +2 -2
  283. label_studio_sdk/views/types/views_create_request_data_filters.py +2 -2
  284. label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +2 -2
  285. label_studio_sdk/views/types/views_update_request_data.py +2 -2
  286. label_studio_sdk/views/types/views_update_request_data_filters.py +2 -2
  287. label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +2 -2
  288. label_studio_sdk/webhooks/__init__.py +36 -2
  289. label_studio_sdk/webhooks/client.py +173 -367
  290. label_studio_sdk/webhooks/types/__init__.py +34 -2
  291. label_studio_sdk/webhooks/types/webhooks_info_response.py +80 -0
  292. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +24 -0
  293. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +24 -0
  294. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +24 -0
  295. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +24 -0
  296. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +24 -0
  297. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +24 -0
  298. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +24 -0
  299. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +24 -0
  300. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +24 -0
  301. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +24 -0
  302. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +24 -0
  303. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +24 -0
  304. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +24 -0
  305. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +24 -0
  306. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +24 -0
  307. label_studio_sdk/workspaces/__init__.py +1 -2
  308. label_studio_sdk/workspaces/client.py +97 -117
  309. label_studio_sdk/workspaces/members/__init__.py +0 -3
  310. label_studio_sdk/workspaces/members/client.py +65 -81
  311. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/METADATA +1 -1
  312. label_studio_sdk-2.0.0.dist-info/RECORD +424 -0
  313. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/WHEEL +1 -1
  314. label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +0 -34
  315. label_studio_sdk/export_storage/azure/types/__init__.py +0 -6
  316. label_studio_sdk/export_storage/azure/types/azure_create_response.py +0 -57
  317. label_studio_sdk/export_storage/azure/types/azure_update_response.py +0 -57
  318. label_studio_sdk/export_storage/gcs/types/__init__.py +0 -6
  319. label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +0 -57
  320. label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +0 -57
  321. label_studio_sdk/export_storage/local/types/__init__.py +0 -6
  322. label_studio_sdk/export_storage/local/types/local_create_response.py +0 -47
  323. label_studio_sdk/export_storage/local/types/local_update_response.py +0 -47
  324. label_studio_sdk/export_storage/redis/types/__init__.py +0 -6
  325. label_studio_sdk/export_storage/redis/types/redis_create_response.py +0 -62
  326. label_studio_sdk/export_storage/redis/types/redis_update_response.py +0 -62
  327. label_studio_sdk/export_storage/s3/types/__init__.py +0 -6
  328. label_studio_sdk/export_storage/s3/types/s3create_response.py +0 -81
  329. label_studio_sdk/export_storage/s3/types/s3update_response.py +0 -81
  330. label_studio_sdk/import_storage/azure/types/__init__.py +0 -6
  331. label_studio_sdk/import_storage/azure/types/azure_create_response.py +0 -72
  332. label_studio_sdk/import_storage/azure/types/azure_update_response.py +0 -72
  333. label_studio_sdk/import_storage/gcs/types/__init__.py +0 -6
  334. label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +0 -72
  335. label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +0 -72
  336. label_studio_sdk/import_storage/local/types/__init__.py +0 -6
  337. label_studio_sdk/import_storage/local/types/local_create_response.py +0 -47
  338. label_studio_sdk/import_storage/local/types/local_update_response.py +0 -47
  339. label_studio_sdk/import_storage/redis/types/__init__.py +0 -6
  340. label_studio_sdk/import_storage/redis/types/redis_create_response.py +0 -62
  341. label_studio_sdk/import_storage/redis/types/redis_update_response.py +0 -62
  342. label_studio_sdk/import_storage/s3/types/__init__.py +0 -6
  343. label_studio_sdk/ml/types/ml_create_response.py +0 -68
  344. label_studio_sdk/ml/types/ml_create_response_auth_method.py +0 -5
  345. label_studio_sdk/ml/types/ml_update_response.py +0 -68
  346. label_studio_sdk/ml/types/ml_update_response_auth_method.py +0 -5
  347. label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +0 -44
  348. label_studio_sdk/projects/types/projects_create_response.py +0 -91
  349. label_studio_sdk/projects/types/projects_update_response.py +0 -96
  350. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +0 -32
  351. label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +0 -59
  352. label_studio_sdk/tasks/types/tasks_list_response.py +0 -38
  353. label_studio_sdk/types/annotation_completed_by.py +0 -6
  354. label_studio_sdk/types/azure_blob_export_storage_status.py +0 -7
  355. label_studio_sdk/types/base_task_updated_by.py +0 -7
  356. label_studio_sdk/types/comment_created_by.py +0 -5
  357. label_studio_sdk/types/converted_format_status.py +0 -5
  358. label_studio_sdk/types/data_manager_task_serializer.py +0 -118
  359. label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +0 -5
  360. label_studio_sdk/types/data_manager_task_serializer_comment_authors_item.py +0 -5
  361. label_studio_sdk/types/data_manager_task_serializer_predictions_item_model_run.py +0 -5
  362. label_studio_sdk/types/export_format.py +0 -25
  363. label_studio_sdk/types/export_snapshot_status.py +0 -5
  364. label_studio_sdk/types/export_status.py +0 -5
  365. label_studio_sdk/types/gcs_export_storage_status.py +0 -7
  366. label_studio_sdk/types/gcs_import_storage_status.py +0 -7
  367. label_studio_sdk/types/inference_run.py +0 -34
  368. label_studio_sdk/types/inference_run_created_by.py +0 -5
  369. label_studio_sdk/types/inference_run_organization.py +0 -5
  370. label_studio_sdk/types/inference_run_project_subset.py +0 -5
  371. label_studio_sdk/types/key_indicators.py +0 -6
  372. label_studio_sdk/types/key_indicators_item.py +0 -41
  373. label_studio_sdk/types/local_files_export_storage_status.py +0 -7
  374. label_studio_sdk/types/local_files_import_storage_status.py +0 -7
  375. label_studio_sdk/types/ml_backend_auth_method.py +0 -5
  376. label_studio_sdk/types/ml_backend_state.py +0 -5
  377. label_studio_sdk/types/model_provider_connection_created_by.py +0 -5
  378. label_studio_sdk/types/model_provider_connection_organization.py +0 -5
  379. label_studio_sdk/types/model_provider_connection_provider.py +0 -7
  380. label_studio_sdk/types/model_provider_connection_scope.py +0 -5
  381. label_studio_sdk/types/pause_paused_by.py +0 -5
  382. label_studio_sdk/types/project_import_status.py +0 -5
  383. label_studio_sdk/types/prompt.py +0 -71
  384. label_studio_sdk/types/prompt_associated_projects_item.py +0 -6
  385. label_studio_sdk/types/prompt_created_by.py +0 -5
  386. label_studio_sdk/types/prompt_organization.py +0 -5
  387. label_studio_sdk/types/prompt_version.py +0 -32
  388. label_studio_sdk/types/prompt_version_created_by.py +0 -5
  389. label_studio_sdk/types/prompt_version_organization.py +0 -5
  390. label_studio_sdk/types/redis_export_storage_status.py +0 -7
  391. label_studio_sdk/types/redis_import_storage_status.py +0 -7
  392. label_studio_sdk/types/refined_prompt_response_refinement_status.py +0 -7
  393. label_studio_sdk/types/s3export_storage_status.py +0 -7
  394. label_studio_sdk/types/s3import_storage_status.py +0 -7
  395. label_studio_sdk/types/s3s_export_storage.py +0 -73
  396. label_studio_sdk/types/s3s_import_storage_status.py +0 -7
  397. label_studio_sdk/types/task.py +0 -156
  398. label_studio_sdk/types/task_annotators_item.py +0 -5
  399. label_studio_sdk/types/task_comment_authors_item.py +0 -5
  400. label_studio_sdk/types/task_filter_options.py +0 -39
  401. label_studio_sdk/types/webhook_actions_item.py +0 -21
  402. label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +0 -21
  403. label_studio_sdk/versions/types/__init__.py +0 -6
  404. label_studio_sdk/versions/types/versions_get_response.py +0 -73
  405. label_studio_sdk/versions/types/versions_get_response_edition.py +0 -5
  406. label_studio_sdk/workspaces/members/types/__init__.py +0 -6
  407. label_studio_sdk/workspaces/members/types/members_create_response.py +0 -22
  408. label_studio_sdk/workspaces/members/types/members_list_response_item.py +0 -22
  409. label_studio_sdk-1.0.20.dist-info/RECORD +0 -374
  410. {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.local_files_import_storage import LocalFilesImportStorage
7
- from ...core.pydantic_utilities import parse_obj_as
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, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
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[LocalFilesImportStorage]:
26
28
  """
27
-
28
- If you have local files that you want to add to Label Studio from a specific directory, you can set up a specific local directory on the machine where LS is running as source or target storage. Use this API request to get a list of all local file import (source) 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 import 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/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[LocalFilesImportStorage],
68
- parse_obj_as(
69
+ construct_type(
69
70
  type_=typing.List[LocalFilesImportStorage], # 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
- ) -> LocalCreateResponse:
89
+ ) -> LocalFilesImportStorage:
89
90
  """
90
-
91
- Create a new source 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 imported until you [sync your connection](sync).</Tip>
91
+ Create a new local file import storage connection.
96
92
 
97
93
  Parameters
98
94
  ----------
@@ -119,7 +115,7 @@ class LocalClient:
119
115
 
120
116
  Returns
121
117
  -------
122
- LocalCreateResponse
118
+ LocalFilesImportStorage
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
- LocalCreateResponse,
155
- parse_obj_as(
156
- type_=LocalCreateResponse, # type: ignore
150
+ LocalFilesImportStorage,
151
+ construct_type(
152
+ type_=LocalFilesImportStorage, # 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 import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import 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.import_storage.local.validate()
219
- """
220
- _response = self._client_wrapper.httpx_client.request(
221
- "api/storages/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) -> LocalFilesImportStorage:
247
162
  """
248
-
249
- Get a specific local file import storage connection. You will need to provide the import storage ID. You can find this using [List import 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 import storage connection.
252
164
 
253
165
  Parameters
254
166
  ----------
255
167
  id : int
256
- A unique integer value identifying this local files import 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
  LocalFilesImportStorage,
286
- parse_obj_as(
197
+ construct_type(
287
198
  type_=LocalFilesImportStorage, # type: ignore
288
199
  object_=_response.json(),
289
200
  ),
@@ -295,17 +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 import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
300
-
301
- Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.
302
-
303
- 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 import storage connection.
304
210
 
305
211
  Parameters
306
212
  ----------
307
213
  id : int
308
- A unique integer value identifying this local files import storage.
309
214
 
310
215
  request_options : typing.Optional[RequestOptions]
311
216
  Request-specific configuration.
@@ -349,17 +254,13 @@ class LocalClient:
349
254
  regex_filter: typing.Optional[str] = OMIT,
350
255
  use_blob_urls: typing.Optional[bool] = OMIT,
351
256
  request_options: typing.Optional[RequestOptions] = None,
352
- ) -> LocalUpdateResponse:
257
+ ) -> LocalFilesImportStorage:
353
258
  """
354
-
355
- Update a specific local import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
356
-
357
- 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 import storage connection.
358
260
 
359
261
  Parameters
360
262
  ----------
361
263
  id : int
362
- A unique integer value identifying this local files import storage.
363
264
 
364
265
  title : typing.Optional[str]
365
266
  Storage title
@@ -384,7 +285,7 @@ class LocalClient:
384
285
 
385
286
  Returns
386
287
  -------
387
- LocalUpdateResponse
288
+ LocalFilesImportStorage
388
289
 
389
290
 
390
291
  Examples
@@ -418,9 +319,9 @@ class LocalClient:
418
319
  try:
419
320
  if 200 <= _response.status_code < 300:
420
321
  return typing.cast(
421
- LocalUpdateResponse,
422
- parse_obj_as(
423
- type_=LocalUpdateResponse, # type: ignore
322
+ LocalFilesImportStorage,
323
+ construct_type(
324
+ type_=LocalFilesImportStorage, # type: ignore
424
325
  object_=_response.json(),
425
326
  ),
426
327
  )
@@ -431,12 +332,7 @@ class LocalClient:
431
332
 
432
333
  def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesImportStorage:
433
334
  """
434
-
435
- Sync tasks from a local import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
436
-
437
- Sync operations with external sources only go one way. They either create tasks from objects in the source 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.
438
-
439
- <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 import storage connection.
440
336
 
441
337
  Parameters
442
338
  ----------
@@ -471,7 +367,7 @@ class LocalClient:
471
367
  if 200 <= _response.status_code < 300:
472
368
  return typing.cast(
473
369
  LocalFilesImportStorage,
474
- parse_obj_as(
370
+ construct_type(
475
371
  type_=LocalFilesImportStorage, # type: ignore
476
372
  object_=_response.json(),
477
373
  ),
@@ -481,119 +377,115 @@ class LocalClient:
481
377
  raise ApiError(status_code=_response.status_code, body=_response.text)
482
378
  raise ApiError(status_code=_response.status_code, body=_response_json)
483
379
 
484
-
485
- class AsyncLocalClient:
486
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
487
- self._client_wrapper = client_wrapper
488
-
489
- async def list(
490
- self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
491
- ) -> typing.List[LocalFilesImportStorage]:
380
+ def validate(
381
+ self,
382
+ *,
383
+ id: typing.Optional[int] = OMIT,
384
+ title: typing.Optional[str] = OMIT,
385
+ description: typing.Optional[str] = OMIT,
386
+ project: typing.Optional[int] = OMIT,
387
+ path: typing.Optional[str] = OMIT,
388
+ regex_filter: typing.Optional[str] = OMIT,
389
+ use_blob_urls: typing.Optional[bool] = OMIT,
390
+ request_options: typing.Optional[RequestOptions] = None,
391
+ ) -> None:
492
392
  """
393
+ Validate a specific local file import storage connection.
493
394
 
494
- If you have local files that you want to add to Label Studio from a specific directory, you can set up a specific local directory on the machine where LS is running as source or target storage. Use this API request to get a list of all local file import (source) storage connections for a specific project.
395
+ Parameters
396
+ ----------
397
+ id : typing.Optional[int]
398
+ Storage ID. If set, storage with specified ID will be updated
495
399
 
496
- 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).
400
+ title : typing.Optional[str]
401
+ Storage title
497
402
 
498
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
403
+ description : typing.Optional[str]
404
+ Storage description
499
405
 
500
- Parameters
501
- ----------
502
406
  project : typing.Optional[int]
503
407
  Project ID
504
408
 
409
+ path : typing.Optional[str]
410
+ Path to local directory
411
+
412
+ regex_filter : typing.Optional[str]
413
+ Regex for filtering objects
414
+
415
+ use_blob_urls : typing.Optional[bool]
416
+ 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.
417
+
505
418
  request_options : typing.Optional[RequestOptions]
506
419
  Request-specific configuration.
507
420
 
508
421
  Returns
509
422
  -------
510
- typing.List[LocalFilesImportStorage]
511
-
423
+ None
512
424
 
513
425
  Examples
514
426
  --------
515
- import asyncio
516
-
517
- from label_studio_sdk import AsyncLabelStudio
427
+ from label_studio_sdk import LabelStudio
518
428
 
519
- client = AsyncLabelStudio(
429
+ client = LabelStudio(
520
430
  api_key="YOUR_API_KEY",
521
431
  )
522
-
523
-
524
- async def main() -> None:
525
- await client.import_storage.local.list()
526
-
527
-
528
- asyncio.run(main())
432
+ client.import_storage.local.validate()
529
433
  """
530
- _response = await self._client_wrapper.httpx_client.request(
531
- "api/storages/localfiles/",
532
- method="GET",
533
- params={
434
+ _response = self._client_wrapper.httpx_client.request(
435
+ "api/storages/localfiles/validate",
436
+ method="POST",
437
+ json={
438
+ "id": id,
439
+ "title": title,
440
+ "description": description,
534
441
  "project": project,
442
+ "path": path,
443
+ "regex_filter": regex_filter,
444
+ "use_blob_urls": use_blob_urls,
445
+ },
446
+ headers={
447
+ "content-type": "application/json",
535
448
  },
536
449
  request_options=request_options,
450
+ omit=OMIT,
537
451
  )
538
452
  try:
539
453
  if 200 <= _response.status_code < 300:
540
- return typing.cast(
541
- typing.List[LocalFilesImportStorage],
542
- parse_obj_as(
543
- type_=typing.List[LocalFilesImportStorage], # type: ignore
544
- object_=_response.json(),
545
- ),
546
- )
454
+ return
547
455
  _response_json = _response.json()
548
456
  except JSONDecodeError:
549
457
  raise ApiError(status_code=_response.status_code, body=_response.text)
550
458
  raise ApiError(status_code=_response.status_code, body=_response_json)
551
459
 
552
- async def create(
460
+
461
+ class AsyncLocalClient:
462
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
463
+ self._client_wrapper = client_wrapper
464
+
465
+ async def list(
553
466
  self,
554
467
  *,
555
- title: typing.Optional[str] = OMIT,
556
- description: typing.Optional[str] = OMIT,
557
- project: typing.Optional[int] = OMIT,
558
- path: typing.Optional[str] = OMIT,
559
- regex_filter: typing.Optional[str] = OMIT,
560
- use_blob_urls: typing.Optional[bool] = OMIT,
468
+ ordering: typing.Optional[str] = None,
469
+ project: typing.Optional[int] = None,
561
470
  request_options: typing.Optional[RequestOptions] = None,
562
- ) -> LocalCreateResponse:
471
+ ) -> typing.List[LocalFilesImportStorage]:
563
472
  """
564
-
565
- Create a new source storage connection to a local file directory.
566
-
567
- For information about the required fields and prerequisites, see [Local storage](https://labelstud.io/guide/storage#Local-storage) in the Label Studio documentation.
568
-
569
- <Tip>After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you [sync your connection](sync).</Tip>
473
+ Get a list of all local file import storage connections.
570
474
 
571
475
  Parameters
572
476
  ----------
573
- title : typing.Optional[str]
574
- Storage title
575
-
576
- description : typing.Optional[str]
577
- Storage description
477
+ ordering : typing.Optional[str]
478
+ Which field to use when ordering the results.
578
479
 
579
480
  project : typing.Optional[int]
580
481
  Project ID
581
482
 
582
- path : typing.Optional[str]
583
- Path to local directory
584
-
585
- regex_filter : typing.Optional[str]
586
- Regex for filtering objects
587
-
588
- use_blob_urls : typing.Optional[bool]
589
- 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.
590
-
591
483
  request_options : typing.Optional[RequestOptions]
592
484
  Request-specific configuration.
593
485
 
594
486
  Returns
595
487
  -------
596
- LocalCreateResponse
488
+ typing.List[LocalFilesImportStorage]
597
489
 
598
490
 
599
491
  Examples
@@ -608,34 +500,26 @@ class AsyncLocalClient:
608
500
 
609
501
 
610
502
  async def main() -> None:
611
- await client.import_storage.local.create()
503
+ await client.import_storage.local.list()
612
504
 
613
505
 
614
506
  asyncio.run(main())
615
507
  """
616
508
  _response = await self._client_wrapper.httpx_client.request(
617
509
  "api/storages/localfiles/",
618
- method="POST",
619
- json={
620
- "title": title,
621
- "description": description,
510
+ method="GET",
511
+ params={
512
+ "ordering": ordering,
622
513
  "project": project,
623
- "path": path,
624
- "regex_filter": regex_filter,
625
- "use_blob_urls": use_blob_urls,
626
- },
627
- headers={
628
- "content-type": "application/json",
629
514
  },
630
515
  request_options=request_options,
631
- omit=OMIT,
632
516
  )
633
517
  try:
634
518
  if 200 <= _response.status_code < 300:
635
519
  return typing.cast(
636
- LocalCreateResponse,
637
- parse_obj_as(
638
- type_=LocalCreateResponse, # type: ignore
520
+ typing.List[LocalFilesImportStorage],
521
+ construct_type(
522
+ type_=typing.List[LocalFilesImportStorage], # type: ignore
639
523
  object_=_response.json(),
640
524
  ),
641
525
  )
@@ -644,10 +528,9 @@ class AsyncLocalClient:
644
528
  raise ApiError(status_code=_response.status_code, body=_response.text)
645
529
  raise ApiError(status_code=_response.status_code, body=_response_json)
646
530
 
647
- async def validate(
531
+ async def create(
648
532
  self,
649
533
  *,
650
- id: typing.Optional[int] = OMIT,
651
534
  title: typing.Optional[str] = OMIT,
652
535
  description: typing.Optional[str] = OMIT,
653
536
  project: typing.Optional[int] = OMIT,
@@ -655,16 +538,12 @@ class AsyncLocalClient:
655
538
  regex_filter: typing.Optional[str] = OMIT,
656
539
  use_blob_urls: typing.Optional[bool] = OMIT,
657
540
  request_options: typing.Optional[RequestOptions] = None,
658
- ) -> None:
541
+ ) -> LocalFilesImportStorage:
659
542
  """
660
-
661
- Validate a specific local file import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
543
+ Create a new local file import storage connection.
662
544
 
663
545
  Parameters
664
546
  ----------
665
- id : typing.Optional[int]
666
- Storage ID. If set, storage with specified ID will be updated
667
-
668
547
  title : typing.Optional[str]
669
548
  Storage title
670
549
 
@@ -688,7 +567,8 @@ class AsyncLocalClient:
688
567
 
689
568
  Returns
690
569
  -------
691
- None
570
+ LocalFilesImportStorage
571
+
692
572
 
693
573
  Examples
694
574
  --------
@@ -702,16 +582,15 @@ class AsyncLocalClient:
702
582
 
703
583
 
704
584
  async def main() -> None:
705
- await client.import_storage.local.validate()
585
+ await client.import_storage.local.create()
706
586
 
707
587
 
708
588
  asyncio.run(main())
709
589
  """
710
590
  _response = await self._client_wrapper.httpx_client.request(
711
- "api/storages/localfiles/validate",
591
+ "api/storages/localfiles/",
712
592
  method="POST",
713
593
  json={
714
- "id": id,
715
594
  "title": title,
716
595
  "description": description,
717
596
  "project": project,
@@ -727,7 +606,13 @@ class AsyncLocalClient:
727
606
  )
728
607
  try:
729
608
  if 200 <= _response.status_code < 300:
730
- return
609
+ return typing.cast(
610
+ LocalFilesImportStorage,
611
+ construct_type(
612
+ type_=LocalFilesImportStorage, # type: ignore
613
+ object_=_response.json(),
614
+ ),
615
+ )
731
616
  _response_json = _response.json()
732
617
  except JSONDecodeError:
733
618
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -735,15 +620,11 @@ class AsyncLocalClient:
735
620
 
736
621
  async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesImportStorage:
737
622
  """
738
-
739
- Get a specific local file import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
740
-
741
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
623
+ Get a specific local file import storage connection.
742
624
 
743
625
  Parameters
744
626
  ----------
745
627
  id : int
746
- A unique integer value identifying this local files import storage.
747
628
 
748
629
  request_options : typing.Optional[RequestOptions]
749
630
  Request-specific configuration.
@@ -781,7 +662,7 @@ class AsyncLocalClient:
781
662
  if 200 <= _response.status_code < 300:
782
663
  return typing.cast(
783
664
  LocalFilesImportStorage,
784
- parse_obj_as(
665
+ construct_type(
785
666
  type_=LocalFilesImportStorage, # type: ignore
786
667
  object_=_response.json(),
787
668
  ),
@@ -793,17 +674,11 @@ class AsyncLocalClient:
793
674
 
794
675
  async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
795
676
  """
796
-
797
- Delete a specific local import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
798
-
799
- Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.
800
-
801
- 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.
677
+ Delete a specific local file import storage connection.
802
678
 
803
679
  Parameters
804
680
  ----------
805
681
  id : int
806
- A unique integer value identifying this local files import storage.
807
682
 
808
683
  request_options : typing.Optional[RequestOptions]
809
684
  Request-specific configuration.
@@ -855,17 +730,13 @@ class AsyncLocalClient:
855
730
  regex_filter: typing.Optional[str] = OMIT,
856
731
  use_blob_urls: typing.Optional[bool] = OMIT,
857
732
  request_options: typing.Optional[RequestOptions] = None,
858
- ) -> LocalUpdateResponse:
733
+ ) -> LocalFilesImportStorage:
859
734
  """
860
-
861
- Update a specific local import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
862
-
863
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
735
+ Update a specific local file import storage connection.
864
736
 
865
737
  Parameters
866
738
  ----------
867
739
  id : int
868
- A unique integer value identifying this local files import storage.
869
740
 
870
741
  title : typing.Optional[str]
871
742
  Storage title
@@ -890,7 +761,7 @@ class AsyncLocalClient:
890
761
 
891
762
  Returns
892
763
  -------
893
- LocalUpdateResponse
764
+ LocalFilesImportStorage
894
765
 
895
766
 
896
767
  Examples
@@ -932,9 +803,9 @@ class AsyncLocalClient:
932
803
  try:
933
804
  if 200 <= _response.status_code < 300:
934
805
  return typing.cast(
935
- LocalUpdateResponse,
936
- parse_obj_as(
937
- type_=LocalUpdateResponse, # type: ignore
806
+ LocalFilesImportStorage,
807
+ construct_type(
808
+ type_=LocalFilesImportStorage, # type: ignore
938
809
  object_=_response.json(),
939
810
  ),
940
811
  )
@@ -947,12 +818,7 @@ class AsyncLocalClient:
947
818
  self, id: int, *, request_options: typing.Optional[RequestOptions] = None
948
819
  ) -> LocalFilesImportStorage:
949
820
  """
950
-
951
- Sync tasks from a local import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
952
-
953
- Sync operations with external sources only go one way. They either create tasks from objects in the source 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.
954
-
955
- <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>
821
+ Sync tasks from a local file import storage connection.
956
822
 
957
823
  Parameters
958
824
  ----------
@@ -995,7 +861,7 @@ class AsyncLocalClient:
995
861
  if 200 <= _response.status_code < 300:
996
862
  return typing.cast(
997
863
  LocalFilesImportStorage,
998
- parse_obj_as(
864
+ construct_type(
999
865
  type_=LocalFilesImportStorage, # type: ignore
1000
866
  object_=_response.json(),
1001
867
  ),
@@ -1004,3 +870,91 @@ class AsyncLocalClient:
1004
870
  except JSONDecodeError:
1005
871
  raise ApiError(status_code=_response.status_code, body=_response.text)
1006
872
  raise ApiError(status_code=_response.status_code, body=_response_json)
873
+
874
+ async def validate(
875
+ self,
876
+ *,
877
+ id: typing.Optional[int] = OMIT,
878
+ title: typing.Optional[str] = OMIT,
879
+ description: typing.Optional[str] = OMIT,
880
+ project: typing.Optional[int] = OMIT,
881
+ path: typing.Optional[str] = OMIT,
882
+ regex_filter: typing.Optional[str] = OMIT,
883
+ use_blob_urls: typing.Optional[bool] = OMIT,
884
+ request_options: typing.Optional[RequestOptions] = None,
885
+ ) -> None:
886
+ """
887
+ Validate a specific local file import storage connection.
888
+
889
+ Parameters
890
+ ----------
891
+ id : typing.Optional[int]
892
+ Storage ID. If set, storage with specified ID will be updated
893
+
894
+ title : typing.Optional[str]
895
+ Storage title
896
+
897
+ description : typing.Optional[str]
898
+ Storage description
899
+
900
+ project : typing.Optional[int]
901
+ Project ID
902
+
903
+ path : typing.Optional[str]
904
+ Path to local directory
905
+
906
+ regex_filter : typing.Optional[str]
907
+ Regex for filtering objects
908
+
909
+ use_blob_urls : typing.Optional[bool]
910
+ 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.
911
+
912
+ request_options : typing.Optional[RequestOptions]
913
+ Request-specific configuration.
914
+
915
+ Returns
916
+ -------
917
+ None
918
+
919
+ Examples
920
+ --------
921
+ import asyncio
922
+
923
+ from label_studio_sdk import AsyncLabelStudio
924
+
925
+ client = AsyncLabelStudio(
926
+ api_key="YOUR_API_KEY",
927
+ )
928
+
929
+
930
+ async def main() -> None:
931
+ await client.import_storage.local.validate()
932
+
933
+
934
+ asyncio.run(main())
935
+ """
936
+ _response = await self._client_wrapper.httpx_client.request(
937
+ "api/storages/localfiles/validate",
938
+ method="POST",
939
+ json={
940
+ "id": id,
941
+ "title": title,
942
+ "description": description,
943
+ "project": project,
944
+ "path": path,
945
+ "regex_filter": regex_filter,
946
+ "use_blob_urls": use_blob_urls,
947
+ },
948
+ headers={
949
+ "content-type": "application/json",
950
+ },
951
+ request_options=request_options,
952
+ omit=OMIT,
953
+ )
954
+ try:
955
+ if 200 <= _response.status_code < 300:
956
+ return
957
+ _response_json = _response.json()
958
+ except JSONDecodeError:
959
+ raise ApiError(status_code=_response.status_code, body=_response.text)
960
+ raise ApiError(status_code=_response.status_code, body=_response_json)