List data models

async AsyncCogniteClient.data_modeling.data_models.list(
inline_views: bool = False,
limit: int | None = 10,
space: str | None = None,
all_versions: bool = False,
include_global: bool = False,
) DataModelList[View] | DataModelList[ViewId]

List data models.

Parameters:
  • inline_views (bool) – Whether to expand the referenced views inline in the returned result.

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

  • space (str | None) – The space to query.

  • all_versions (bool) – Whether to return all versions. If false, only the newest version is returned, which is determined based on the ‘createdTime’ field.

  • include_global (bool) – Whether to include global data models.

Returns:

List of requested data models

Return type:

DataModelList[View] | DataModelList[ViewId]

Examples

List 5 data model:

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

Iterate over data model, one-by-one:

>>> for data_model in client.data_modeling.data_models():
...     data_model  # do something with the data model

Iterate over chunks of data model to reduce memory load:

>>> for data_model_list in client.data_modeling.data_models(chunk_size=10):
...     data_model_list  # do something with the data model