List spaces

async AsyncCogniteClient.data_modeling.spaces.list(
limit: int | None = 25,
include_global: bool = False,
) SpaceList

List spaces.

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

  • include_global (bool) – Whether to include global spaces. Defaults to False.

Returns:

List of requested spaces

Return type:

SpaceList

Examples

List spaces and filter on max start time:

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

Iterate over spaces, one-by-one:

>>> for space in client.data_modeling.spaces():
...     space  # do something with the space

Iterate over chunks of spaces to reduce memory load:

>>> for space_list in client.data_modeling.spaces(chunk_size=2500):
...     space_list  # do something with the spaces