List sources
- async AsyncCogniteClient.hosted_extractors.sources.list(
- limit: int | None = 25,
-
- Parameters:
limit (int | None) – Maximum number of sources to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.
- Returns:
List of requested sources
- Return type:
SourceList
Examples
List sources:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> source_list = client.hosted_extractors.sources.list(limit=5)
Iterate over sources, one-by-one:
>>> for source in client.hosted_extractors.sources(): ... source # do something with the source
Iterate over chunks of sources to reduce memory load:
>>> for source_list in client.hosted_extractors.sources(chunk_size=25): ... source_list # do something with the sources