Skip to main content
Collections group data points within a dataset. They help represent logical groupings of data points that are commonly queried together. For example, if your dataset includes data from a specific instrument on different satellites, you can group the data points from each satellite into a collection. Refer to the examples below for common use cases when working with collections. These examples assume that you have already created a client and selected a dataset as shown below.

Listing collections

To list the collections for a dataset, use the collections method on the dataset object.
Output
dataset.collections returns a dictionary mapping collection names to their corresponding collection objects. Each collection has a unique name within its dataset.

Creating collections

To create a collection in a dataset, use dataset.create_collection(). This method returns the created collection object.
You can use dataset.get_or_create_collection() to get a collection by its name. If the collection does not exist, it will be created.

Accessing individual collections

Once you have listed the collections for a dataset using dataset.collections(), you can access a specific collection by retrieving it from the resulting dictionary with its name. Use collection.info() in Python or String() in Go to get details (name, availability, and count) about it.
Output
You can also access a specific collection directly using the dataset.collection method on the dataset object. This method allows you to get the collection without having to list all collections first.
Output

Deleting collections

Collections can be deleted from a dataset using the delete_collection method. To delete a collection, you need to have write permission on the dataset.
Deleting a collection will delete all data points in the collection.

Errors you may encounter

NotFoundError

If you attempt to access a collection with a non-existent name, a NotFoundError is raised. For example:

Next steps

Query Data

Learn how to query data from a collection.