Table of Contents


Alex Cota Updated by Alex Cota

These are some common use cases people have when working with Labels in the Python SDK. For a complete list of methods, see our API reference.

For the definition of a Label, see Overview & data types.

Before you start

Make sure the client is initialized.

from labelbox import Client
client = Client()

Export labels

The sample below uses the export_labels method to print a URL to a JSON file containing the labels of a project.

project = client.get_project("<project_unique_id>")
url = project.export_labels()

The response will be a URL of the label data file.


Bulk Delete Labels

Use the bulk_delete method for deleting multiple labels at a time. Users usually seek to do this when they realize there was an error in the way that the labels were initially created. This method allows you to remove the existing annotations.

Here are two ways for bulk deleting labels within a specified project.

a. Specify a project and delete use the bulk_delete method to delete all labels from that project.

project = client.get_project("<project_unique_id>")

b. Do a filtered relationship expansion to specify which labels to delete within a project.

project = client.get_project("<project_unique_id>")

Was this page helpful?

Data Rows

General concepts