Skip to content

cmem_client.repositories.base.plain_list¤

Repository implementation for simple list API endpoints.

This module provides PlainListRepository, a repository implementation for API endpoints that return a simple array of objects without pagination. It’s commonly used with Corporate Memory’s DataIntegration (build) APIs that provide straightforward list responses.

The PlainListRepository fetches the entire list in a single request and provides dictionary-like access to the items by their ID.

Classes:

PlainListRepository¤

Bases: Repository

Subclass of a ReadRepository that uses a plain list endpoint.

Attributes:

  • _dict (dict[str, PlainListRepository[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 (RepositoryConfig) – Describes which endpoint the repository fetches its data from.

Functions:

  • fetch_data – Fetch simple list from a JSON endpoint via a type adapter
  • 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 simple list from a JSON endpoint via a type adapter

Use this method to fetch data when your result set is an array of objects.

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

Comments