For the complete documentation index, see llms.txt. This page is also available as Markdown.

upload_files

imerit_ango.sdk.SDK.

upload_files(project_id, file_paths, storage_id, batches, priority)

Upload local files to your project.

Parameters

  • project_id: string

  • file_paths: List[str]

    • A list containing absolute paths to files and, optionally, their contextData.

    • Example:

[
    {
        "data": "/Users/lorenzo/Desktop/Gassino,_arrival_of_tramway_auto_x2.jpg",
        "metadata": {
            "width": 1500,
            "height": 1200
        },
        "contextData": {
            "key1": "value1"
        }
    }
]
  • storage_id: string, Optional, default None

    • This parameter has no function anymore and will be deprecated in the next version of the SDK.

  • batches: List[str], Optional, default None

    • You may assign the files you are uploading to one or more batches that exist in your project by providing their IDs here. You may create new batches with create_batch and you can get a list of batches with get_batches.

    • Example: ['0000000aa0a00a0000aaaa0a', '0000000aa0a00a0000aaaa0b']

  • priority: int, Optional, default 0

    • The new priority value to assign to the uploaded assets.

    • Note: The priority value must be between -1000 and 1000. Higher values indicate higher priority.

Returns:

  • output: dict

    • A dictionary containing the result of the operation.

    • Including a status field indicating whether the request was successful and a data field containing the response payload with updated resources produced by the operation.

The SDK does not set a separate maximum number of files for one upload_files call. Project and organization quotas count assets. After uploading the local files, this method registers them through upload_files_cloud; that final JSON request is limited to 50 MiB (52,428,800 bytes) by the API. File contents are uploaded separately and do not count toward the JSON request size.

For large imports, split files across smaller calls. See Import Limits for project quotas and deployment-specific request limits.

How to verify in Ango Hub?

After successfully executing the upload_files function, you can validate the changes directly in Ango Hub.

Navigate to: Projects → [Your Project] → Asset

  • Ensure that all assets have been successfully imported and are visible in the project.

Changes made via the SDK are reflected in Ango Hub in near real-time. If updates are not immediately visible, please refresh the page.

Example

Importing two local files:

Importing a file with a custom external ID:

Last updated