Table of Contents


Alex Cota Updated by Alex Cota

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

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

Before you start

Make sure the client is initialized.

from labelbox import Client
client = Client()

Create a Project

To learn how to create a Project, see Creating your first project.

Fetch a Project

Since a Project is a top-level object, you can get a specific Project by passing the unique ID of the Project to the client. The get_project method will only take a unique ID as an argument.

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

Fetch multiple Projects

Here are three ways to fetch multiple Projects.

a. Use the get_projects method to get a list of all Projects in your account. This sample code will return the name and uid for each Project.

for project in client.get_projects():
print(, project.uid)

b. Specify a Project by passing a comparison as a where parameter. You can use any of the standard comparison operators (==, !=, >, >=, <, <=) to specify which Projects you want. Because the get_projects method can return any number of results, it will give you a PaginatedCollection object over which you can iterate to get your specified Project.

from labelbox import Project
projects_x = client.get_projects( == "MyProject")

Then, you can iterate over the PaginatedCollection object.

for x in projects_x: 

Or you can use the this code to get your desired object which will raise an error if there is not at least one item in the collection.

item = next(iter(projects_x))

For more information on pagination, see General concepts.

c. Specify a Project by combining comparisons using logical expressions. Currently the where clause supports the logical AND operator.

from labelbox import Project
projects = client.get_projects(where=( == "X") & (Project.description == "Y"))
for x in projects:

Update a Project field

Use the update method to target and modify any updatable value in the object’s type. The key value arguments define which fields should be updated with which values. For a complete list of updatable and non-updatable fields in the Project object, see the API reference.

project = client.get_project("<projectID>")
project.update(name="Project Name")

Was this page helpful?

Project setup script