Create a dataset

from labelbox import Client
client = Client(api_key="<YOUR_API_KEY>")

dataset = client.create_dataset(name="my_new_dataset")

To add data rows, see Data Row for more examples.

# simplest example
dataset.create_data_row(row_data="https://picsum.photos/200/300")

Attach a dataset to project

#Attach the dataset to the project
project.datasets.connect(dataset)

#Detach the dataset from the project
project.datasets.disconnect(dataset)

Get a dataset

# Get dataset by id
dataset = client.get_dataset(DATASET_ID)

# Alternatively, you can get dataset by name
dataset = next(client.get_datasets(where=labelbox.Dataset.name == DATASET_NAME), None)

Update a dataset

dataset.update(name="new_name")

Delete a dataset

dataset.delete()