Skip to content

cmem_client.repositories.base.task_search¤

Repository implementation for Corporate Memory task search endpoints.

This module provides TaskSearchRepository, a specialized repository that uses Corporate Memory’s DataIntegration task search API to find and retrieve items. The search functionality allows for flexible querying with filters, facets, and text search capabilities.

Classes:

TaskSearchRepository¤

Bases: Repository

Subclass of a ReadRepository that uses the task search endpoint.

Attributes:

  • _dict (dict[str, TaskSearchRepository[ItemType]]) – Cached contents of the repository, mapping the key of each item to the item itself. Backs the Mapping interface and is populated by fetch_data().
  • _client (Client) – Corporate Memory client used for the HTTP requests of this repository.
  • _config (TaskSearchRepositoryConfig) – Describes which task search endpoint to query and which task type to search for.

Functions:

  • fetch_data – Fetch a list from the DI task search endpoint via a type adapter.
  • get_task – Get full task details from the API.
  • items – Get the items of the repository
  • keys – Get the keys of the repository
  • values – Get the values of the repository

fetch_data¤

fetch_data()

Fetch a list from the DI task search endpoint via a type adapter.

get_task¤

get_task(project_id, task_id, with_labels=True)

Get full task details from the API.

Parameters:

  • project_id (str) – The project ID.
  • task_id (str) – The task ID.
  • with_labels (bool) – Whether to include labels in the response.

Returns:

  • TaskResponse – The full task details as a TaskResponse model.

items¤

items()

Get the items of the repository

keys¤

keys()

Get the keys of the repository

logger¤

logger: logging.Logger

Gets the client logger

values¤

values()

Get the values of the repository

TaskSearchRepositoryConfig¤

TaskSearchRepositoryConfig(fetch_data_adapter, item_type, component='build', fetch_data_path='/api/workspace/searchItems', facets=None)

Bases: RepositoryConfig

Configuration class for a Task Search read repository

Attributes:

  • component (Literal[‘build’, ‘explore’]) – Which Corporate Memory API endpoint to address: build or explore.
  • fetch_data_path (str) – API path of the task search endpoint.
  • fetch_data_adapter (TypeAdapter) – Pydantic TypeAdapter used to deserialize the search result set.
  • item_type (str) – Task type to search for, sent as itemType in the search request (e.g. dataset or workflow).
  • facets (list[dict[str, Any]] | None) – Facet filters sent as facets in the search request. If None, no facet filtering is applied.

component¤

component: Literal['build', 'explore']

facets¤

facets: list[dict[str, Any]] | None = facets

fetch_data_adapter¤

fetch_data_adapter: TypeAdapter

fetch_data_path¤

fetch_data_path: str

item_type¤

item_type: str = item_type

Comments