cmem_client.repositories.base.abc¤
Abstract base classes and configuration for CMEM repositories.
This module provides the foundational classes for building repositories in the CMEM client:
- RepositoryConfig: Configuration class that defines component type, fetch paths, and data adapters
- Repository: Abstract base class implementing a lazy-loading, read-only, dictionary-like interface for accessing CMEM resources with automatic data fetching and caching capabilities
Classes:
- Repository – ABC of a lazy loading, read-only, dictionary-mimicking repository
- RepositoryConfig – Configuration class for a read repository.
Attributes:
- ItemType –
- KeysViewType –
ItemType¤
KeysViewType¤
Repository¤
Bases: ABC, Mapping
ABC of a lazy loading, read-only, dictionary-mimicking repository
Attributes:
- _dict (
dict[str, Repository[ItemType]]) – Cached contents of the repository, mapping the key of each item to the item itself. Backs the Mapping interface and is populated byfetch_data(). - _client (
Client) – Corporate Memory client used for the HTTP requests of this repository. - _config (
RepositoryConfig) – Describes which endpoint the repository fetches its data from. - _logger (
Logger) – Logger of this repository, created lazily on first access through theloggerproperty as a child of the client logger.
Functions:
- fetch_data – Fetch new data and update the repository
- items – Get the items of the repository
- keys – Get the keys of the repository
- values – Get the values of the repository
fetch_data¤
Fetch new data and update the repository
items¤
Get the items of the repository
keys¤
Get the keys of the repository
logger¤
Gets the client logger
values¤
Get the values of the repository
RepositoryConfig¤
Configuration class for a read repository.
This class defines the essential configuration parameters needed to set up a repository that can fetch data from CMEM components.
Attributes:
- component (
Literal[‘build’, ‘explore’, ‘keycloak’]) – Which Corporate Memory API endpoint to address:build,exploreorkeycloak. - fetch_data_path (
str) – API path used to retrieve the repository data. - fetch_data_adapter (
TypeAdapter) – Pydantic TypeAdapter used to deserialize the API response.