SDK best practices

To get the best experience from the SDK, we recommend the following:

  1. Always use bulk operations. Unless you are testing or working on small datasets, use bulk operations for faster and more reliable performance.

    • create_data_rows instead of create_data_row

    • project.export_v2() instead of project.labels()

    • Label.bulk_delete(labels) instead of [label.delete() for label in labels]

  2. Use get_one() and get_many() methods to get elements of a paginated collection instead of list.

    • list(dataset.data_rows())[0] is going to query for every single data_row in your dataset.
  3. Make sure to use the latest version of the SDK.

    • Labelbox is a rapidly evolving company, and we are constantly adding new features and optimizations.



GraphQL APIs are not meant to be consumed directly

GraphQL APIs may be updated or deprecated at any time without notice. For this reason, Labelbox strongly advises that customers use the Python SDK for all development.

Please note that support for GraphQL APIs is provided on a best-effort basis.