export

imerit_ango.sdk.SDK.

export(project_id, options, zip_file_path)

Export annotated assets together with labels and metadata. Users can customize the export process using an instance of the ExportOptions class and specify the output location.

Parameters

  • project_id: string

  • options: ExportOptions, default ExportOptions()

    • An instance of the ExportOptions class, which defines the configurations for the export operation.

    • ExportOptions class

      • stage: List[str], default ['Complete']

      • batches: List[str], default None

      • export_format: ExportFormats, default ExportFormats.JSON

        • Options:

          • ExportFormats.JSON

          • ExportFormats.NDJSON

        • Note: You must import the enum containing the export formats using from imerit_ango.models.enums import ExportFormats

      • export_type: ExportTypes, default ExportTypes.TASK

        • Options:

          • ExportTypes.TASK

          • ExportTypes.ISSUE

        • Note: You must import the enum containing the export types using from imerit_ango.models.enums import ExportTypes

      • include_key_frames_only: bool, default False

      • sendEmail: bool, default False

      • includeMetadata: bool, default True

      • includeHistory: bool, default True

      • doNotNotify: bool, default True

      • updated_at: TimeFilter, default None

      • created_at: TimeFilter, default None

    • TimeFilter class

      • from_date: datetime, default None

      • to_date: datetime, default None

      • Note: You must import the datetime package: from datetime import datetime

  • zip_file_path: string, optional, default None

    • If included, the export will be directly downloaded as a .zip file instead of being returned as a Python dictionary. This prevents our server from having to unzip and dict-ify the export, reducing loading times.

    • Example: "/Users/lorenzo/Downloads/my_export.zip"

Returns:

  • output: dict

Example

Export all assets:

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

export_data = ango_sdk.export(project_id)

Export assets filtered by created and updated time:

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from datetime import datetime, timedelta
from imerit_ango.models.enums import ExportFormats
from imerit_ango.models.export_options import ExportOptions, TimeFilter

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

export_options = ExportOptions(export_format=ExportFormats.JSON,
                               updated_at=TimeFilter(from_date=datetime.now() - timedelta(days=7), to_date=datetime.now()),
                               created_at=TimeFilter(from_date=datetime.now() - timedelta(days=30), to_date=datetime.now()),
                               stage=["Complete"])

export_data = ango_sdk.export(project_id, options=export_options)

Last updated