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']

        • A list of stage IDs to include in the export.

        • Example: ["Complete", "a0000b0a-1111-0a00-a1a1-a111111111aa"]

        • Note: Usee an empty list to get all stages

      • batches: List[str], default None

        • Filter export by specific batch IDs.

      • export_format: ExportFormats, default ExportFormats.JSON

        • Format of the exported data.

        • Options:

          • ExportFormats.JSON

          • ExportFormats.NDJSON

      • export_type: ExportTypes, default ExportTypes.TASK

        • Type of export.

        • Options:

          • ExportTypes.TASK

          • ExportTypes.ISSUE

      • include_key_frames_only: bool, default False

        • If True, only exports key frames (for video assets).

      • sendEmail: bool, default False

        • If True, sends a notification email when export completes.

      • includeMetadata: bool, default True

        • If True, includes metadata with assets.

      • includeHistory: bool, default True

        • If True, includes annotation history.

      • doNotNotify: bool, default True

        • If True, suppresses system notifications.

      • updated_at: TimeFilter, default None

        • Filter assets by update timestamp.

      • created_at: TimeFilter, default None

        • Filter assets by creation timestamp.

    • TimeFilter class

      • from_date: datetime, default None

        • Start date for filtering.

      • to_date: datetime, default None

        • End date for filtering.

  • zip_file_path: string, optional, default None

    • If specified, exports are downloaded directly as a .zip file instead of being returned as a Python object. This avoids server-side unzipping and speeds up export.

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

Returns:

  • output: list

    • A list containing the result of the export operation.

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