Iterate over sequences

async AsyncCogniteClient.sequences.__call__(
chunk_size: int | None = None,
name: str | None = None,
external_id_prefix: str | None = None,
metadata: dict[str, str] | None = None,
asset_ids: Sequence[int] | None = None,
asset_subtree_ids: int | Sequence[int] | None = None,
asset_subtree_external_ids: str | SequenceNotStr[str] | None = None,
data_set_ids: int | Sequence[int] | None = None,
data_set_external_ids: str | SequenceNotStr[str] | None = None,
created_time: dict[str, Any] | None = None,
last_updated_time: dict[str, Any] | None = None,
limit: int | None = None,
advanced_filter: Filter | dict[str, Any] | None = None,
sort: SequenceSort | str | SortableSequenceProperty | tuple[str, Literal['asc', 'desc']] | tuple[str, Literal['asc', 'desc'], Literal['auto', 'first', 'last']] | list[SequenceSort | str | SortableSequenceProperty | tuple[str, Literal['asc', 'desc']] | tuple[str, Literal['asc', 'desc'], Literal['auto', 'first', 'last']]] | None = None,
) AsyncIterator[Sequence] | AsyncIterator[SequenceList]

Iterate over sequences

Fetches sequences as they are iterated over, so you keep a limited number of objects in memory.

Parameters:
  • chunk_size (int | None) – Number of sequences to return in each chunk. Defaults to yielding one event a time.

  • name (str | None) – Filter out sequences that do not have this exact name.

  • external_id_prefix (str | None) – Filter out sequences that do not have this string as the start of the externalId

  • metadata (dict[str, str] | None) – Filter out sequences that do not match these metadata fields and values (case-sensitive). Format is {“key1”:”value1”,”key2”:”value2”}.

  • asset_ids (Sequence[int] | None) – Filter out sequences that are not linked to any of these assets.

  • asset_subtree_ids (int | Sequence[int] | None) – Only include sequences that have a related asset in a subtree rooted at any of these assetIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

  • asset_subtree_external_ids (str | SequenceNotStr[str] | None) – Only include sequences that have a related asset in a subtree rooted at any of these assetExternalIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

  • data_set_ids (int | Sequence[int] | None) – Return only sequences in the specified data set(s) with this id / these ids.

  • data_set_external_ids (str | SequenceNotStr[str] | None) – Return only sequences in the specified data set(s) with this external id / these external ids.

  • created_time (dict[str, Any] | None) – Range between two timestamps. Possible keys are min and max, with values given as time stamps in ms.

  • last_updated_time (dict[str, Any] | None) – Range between two timestamps. Possible keys are min and max, with values given as time stamps in ms.

  • limit (int | None) – Max number of sequences to return. Defaults to return all items.

  • advanced_filter (Filter | dict[str, Any] | None) – Advanced filter query using the filter DSL (Domain Specific Language). It allows defining complex filtering expressions that combine simple operations, such as equals, prefix, exists, etc., using boolean operators and, or, and not.

  • sort (SortSpec | list[SortSpec] | None) – The criteria to sort by. Defaults to desc for _score_ and asc for all other properties. Sort is not allowed if partitions is used.

Yields:

Sequence | SequenceList – yields Sequence one by one if chunk_size is not specified, else SequenceList objects.