List containers

async AsyncCogniteClient.data_modeling.containers.list(
space: str | None = None,
limit: int | None = 10,
include_global: bool = False,
) ContainerList

List containers.

Parameters:
  • space (str | None) – The space to query

  • limit (int | None) – Maximum number of containers to return. Defaults to 10. Set to -1, float(“inf”) or None to return all items.

  • include_global (bool) – Whether the global containers should be returned.

Returns:

List of requested containers

Return type:

ContainerList

Examples

List containers and limit to 5:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> container_list = client.data_modeling.containers.list(limit=5)

Iterate over containers, one-by-one:

>>> for container in client.data_modeling.containers():
...     container  # do something with the container

Iterate over chunks of containers to reduce memory load:

>>> for container_list in client.data_modeling.containers(chunk_size=10):
...     container_list  # do something with the containers