6262
6363
6464class SAClient (BaseInterfaceFacade , metaclass = TrackableMeta ):
65+ """Create SAClient instance to authorize SDK in a team scope.
66+ In case of no argument has been provided, SA_TOKEN environmental variable
67+ will be checked or $HOME/.superannotate/config.json will be used.
68+
69+ :param token: team token
70+ :type token: str
71+
72+ :param config_path: path to config file
73+ :type config_path: path-like (str or Path)
74+
75+ """
76+
6577 def __init__ (
6678 self ,
6779 token : str = None ,
@@ -618,37 +630,6 @@ def pin_image(
618630 is_pinned = int (pin ),
619631 )
620632
621- def set_images_annotation_statuses (
622- self ,
623- project : Union [NotEmptyStr , dict ],
624- annotation_status : NotEmptyStr ,
625- image_names : Optional [List [NotEmptyStr ]] = None ,
626- ):
627- """Sets annotation statuses of images
628-
629- :param project: project name or folder path (e.g., "project1/folder1")
630- :type project: str
631- :param image_names: image names. If None, all the images in the project will be used
632- :type image_names: list of str
633- :param annotation_status: annotation status to set,
634- should be one of NotStarted InProgress QualityCheck Returned Completed Skipped
635- :type annotation_status: str
636- """
637- warning_msg = (
638- "We're deprecating the set_images_annotation_statuses function. Please use set_annotation_statuses instead. "
639- "Learn more. \n "
640- "https://superannotate.readthedocs.io/en/stable/superannotate.sdk.html#superannotate.set_annotation_statuses"
641- )
642- logger .warning (warning_msg )
643- warnings .warn (warning_msg , DeprecationWarning )
644- project_name , folder_name = extract_project_folder (project )
645- response = self .controller .set_images_annotation_statuses (
646- project_name , folder_name , image_names , annotation_status
647- )
648- if response .errors :
649- raise AppException (response .errors )
650- logger .info ("Annotations status of images changed" )
651-
652633 def delete_images (
653634 self , project : Union [NotEmptyStr , dict ], image_names : Optional [List [str ]] = None
654635 ):
@@ -682,9 +663,7 @@ def delete_images(
682663 f"Images deleted in project { project_name } { '/' + folder_name if folder_name else '' } "
683664 )
684665
685- def delete_items (
686- self , project : str , items : Optional [List [str ]] = None
687- ):
666+ def delete_items (self , project : str , items : Optional [List [str ]] = None ):
688667 """Delete items in a given project.
689668
690669 :param project: project name or folder path (e.g., "project1/folder1")
@@ -700,7 +679,6 @@ def delete_items(
700679 if response .errors :
701680 raise AppException (response .errors )
702681
703-
704682 def assign_items (
705683 self , project : Union [NotEmptyStr , dict ], items : List [str ], user : str
706684 ):
@@ -1427,41 +1405,6 @@ def download_export(
14271405 raise AppException (response .errors )
14281406 logger .info (response .data )
14291407
1430- def set_image_annotation_status (
1431- self ,
1432- project : Union [NotEmptyStr , dict ],
1433- image_name : NotEmptyStr ,
1434- annotation_status : NotEmptyStr ,
1435- ):
1436- """Sets the image annotation status
1437-
1438- :param project: project name or folder path (e.g., "project1/folder1")
1439- :type project: str
1440- :param image_name: image name
1441- :type image_name: str
1442- :param annotation_status: annotation status to set,
1443- should be one of NotStarted InProgress QualityCheck Returned Completed Skipped
1444- :type annotation_status: str
1445-
1446- :return: metadata of the updated image
1447- :rtype: dict
1448- """
1449- warning_msg = (
1450- "We're deprecating the set_image_annotation_status function. Please use set_annotation_statuses instead. "
1451- "Learn more. \n "
1452- "https://superannotate.readthedocs.io/en/stable/superannotate.sdk.html#superannotate.set_annotation_statuses"
1453- )
1454- logger .warning (warning_msg )
1455- warnings .warn (warning_msg , DeprecationWarning )
1456- project_name , folder_name = extract_project_folder (project )
1457- response = self .controller .set_images_annotation_statuses (
1458- project_name , folder_name , [image_name ], annotation_status
1459- )
1460- if response .errors :
1461- raise AppException (response .errors )
1462- image = self .controller .get_item (project_name , folder_name , image_name ).data
1463- return BaseSerializer (image ).serialize ()
1464-
14651408 def set_project_workflow (
14661409 self , project : Union [NotEmptyStr , dict ], new_workflow : List [dict ]
14671410 ):
@@ -1720,7 +1663,7 @@ def download_model(self, model: MLModel, output_dir: Union[str, Path]):
17201663
17211664 :param model: the model that needs to be downloaded
17221665 :type model: dict
1723- :param output_dir: the directiory in which the files will be saved
1666+ :param output_dir: the directory in which the files will be saved
17241667 :type output_dir: str
17251668 :return: the metadata of the model
17261669 :rtype: dict
0 commit comments