Package: datature
:hammer: Datature Python SDK :hammer::zap: Empower your MLOps pipelines and applications with seamless integrations :zap:Automate tasks to manage your datasets, run training experiments, export and deploy your models fromDatature Nexuswith ease. Perform development viaPython scriptsor with theCLI- your choice!:rocket: Getting Started :rocket::snake: Prerequisites3.8<= Python <=3.12We recommend users to create a virtual environment before installing any dependencies. For more information on virtual environments, please refer to:Python venvCondavirtualenvwrapper:gear: Installationpipinstall--upgradedataturePython UsageFor a full list of documentation and examples, please refer to theAPI docs.AuthenticationTo get started, you will first need to create a project onDatature Nexus(signing up is free!). You will then need to locate theproject secret key. This key can only be accessed if you are the Project Owner or been granted elevated permissions by the Project Owner, and will be used for all subsequent authentication when invoking the various SDK functions.ExamplesTo list projects:fromdatatureimportnexusclient=nexus.Client("3736971xxxxx")projects=client.list_projects()To upload assets:importosfromdatatureimportnexuslogging.basicConfig()client=nexus.Client("3736971xxxxx")project=client.list_projects("proj_xxxxx")upload_session=project.assets.create_upload_session(groups=["dataset"])withupload_sessionassession:session.add_path("/Users/dataset")print(len(upload_session))LoggingYou can vary the logging level depending on your task or use case (such asDEBUGto provide more insights), but the defaultINFOlevel is typically best suited for production use.importlogginglogging.basicConfig()logging.getLogger("nexus").setLevel(logging.DEBUG)CLI UsageFor a full list of documentation and examples, please refer to theCLI docs.AuthenticationTo get started, you will first need to create a project onDatature Nexus(signing up is free!). You will then need to locate theproject secret key. This key can only be accessed if you are the Project Owner or been granted elevated permissions by the Project Owner, and will be used for all subsequent authentication when invoking the various SDK functions.Once you have the project secret, you will now be able to make API requests using the CLI by entering the commanddatature projects auth:datatureprojectsauth[?]Entertheprojectsecret:************************************************[?]Make[YourProjectName]thedefaultproject?(Y/n):y

Authenticationsucceeded.You will now be able to run your desired CLI commands as outlined above. To see all possible functions as well as view the required inputs and expected outputs, check out the following documentation.Project Managementdatature projectsShow a help page of various functions to add projects, select the default project, and retrieve project information.Auth Projectdatature projects authAuthenticate new projects using theproject secret key. Multiple projects can be authenticated and stored using different secret keys.Select Projectdatature projects selectSelect an active project to work on from a list of saved projects. All subsequent CLI commands will be in the context of the selected project until a different project is selected, or the shell session is terminated.$datatureprojectsselect>MyCoolProjectNewTestProject

Youractiveprojectisnow:[Dicom]List Projectsdatature projects listView a table of saved projects with columns containing the names of the projects, the total number of assets, the number of annotated assets, the number of annotations, and the number of tags for each project. The name of the active project is displayed at the bottom of the list.$datatureprojectslist

NAMETOTAL_ASSETSANNOTATED_ASSETSANNOTATIONSTAGS
MyCoolProject407143318743NewTestProject718539594Youractiveprojectisnow:[MyCoolProject]Asset ManagementUpload Assetsdatature assets uploadUpload assets toDatature Nexus. You will be prompted to enter the path to the folder containing the assets that you wish to upload, as well as optional group name(s) to categorize the set of assets. This function is designed specially for bulk uploading of large datasets, which accelerates the process of onboarding data for subsequent annotation and training.This function also supports DICOM and NIfTI file upload, which caters to important medical use cases.$datatureassetupload[?]Entertheassetsfolderpathtobeuploaded:/Downloads/Training2[?]Entertheassetsgroupname(s),splitby',':main[?]281assetswillbeuploadedtogroup(s)(main)?(Y/n):
Preparing|████████████████████████████████████████|281/281[100%]in0.1s(2775.28/s)Processing|████████████████████████████████████████|100%[281/281]in1:17.5(3.56/s)Serverprocessingcompleted.Group Assetsdatature assets groupsList asset group information within your project. You will be prompted to select an existing group or create a new group. If you select an existing group, information about the selected group will be displayed, including the total number of assets in the group, the number of assets that have been annotated, reviewed, or marked for fixes, and the number of assets that have been completed.$datatureassetsgroups

>maingroupName2

NAMETOTALANNOTATEDREVIEWTOFIXCOMPLETED
main81000Annotation ManagementUpload Annotationsdatature annotations uploadUpload annotation files toDatature NexusYou will be prompted to enter the path of the annotation file you wish to upload and select asupported annotation format.$datatureannotationsupload[?]Entertheannotationfilespathtobeuploaded:/Users/Downloads/Training.csv
Processing|████████████████████████████████████████|100%[1/1]in7.0s(0.14/s)Serverprocessingcompleted.Download Annotationsdatature annotations downloadDownload annotation files fromDatature Nexus. You will be prompted to enter a path to save the downloaded annotation file to, and select the desiredannotation format.$datatureannotationsdownload[?]Entertheannotationfilespathtobedownload:/Users/Downloads/[?]Selecttheannotationfileformat:csv_widthheightcsv_fourcorner>csv_widthheightcocopascal_vocyolo_keras_pytorchyolo_darknetpolygon_singlepolygon_coco

Processing|████████████████████████████████████████|100%[1/1]in7.0s(0.14/s)Serverprocessingcompleted.Artifact ManagementArtifact Downloaddatature artifacts downloadDownload a model artifact fromDatature Nexus. You will be prompted to enter a folder path to save the model to, and select the name andexport formatof the artifact to download.$datatureartifactsdownload[?]Enterthefolderpathtosavemodel:/Volumes/[?]Whichartifactdoyouwanttodownload?:BEAF45-Workflowc>BEAF45-Workflowc[?]Whichmodelformatdoyouwanttodownload?:tensorflow>tensorflowtfliteonnx

Downloading|████████████████████████████████████████|100%[443421394/443421394]in7.1s(62639992.12/s)