ds_provider_tripletex_py_lib.read_info

File: read_info.py Region: ds_provider_tripletex_py_lib/read_info

Read and field-projection information for Tripletex products.

Each TripletexProductName has a packaged assets/<product_name>/read/metadata.json declaring path, pagination ("date_window" if the endpoint has dateFrom/dateTo, else "offset"), changed_since (use Tripletex’s changedSince filter instead of versionDigest/If-None-Match), a field selector (str, or a one-key dict for a nested group, e.g. {"account": ["id"]}), and an optional explode_columns (fields that are a list of objects, needing one row per element rather than in-place flattening). _lite products reuse a full product’s path with fewer fields.

Classes

ReadInfo

Read information for a single Tripletex product.

Functions

_load_metadata(→ dict[str, Any])

Read and parse one product's packaged operation metadata.

get_read_info(→ ReadInfo)

Load packaged read metadata for a Tripletex product.

Module Contents

class ds_provider_tripletex_py_lib.read_info.ReadInfo[source]

Read information for a single Tripletex product.

path

API path segment appended to the linked service host, e.g. "ledger/posting".

fields

Field selector list used to build the fields query parameter.

changed_since

Whether this product supports Tripletex’s changedSince filter (replaces versionDigest/If-None-Match when True).

pagination

How read() requests are paginated for this product.

explode_columns

Field names that are a list of objects and should be exploded into one row per element, e.g. ["bankAccountPresentation"].

path: str
fields: list[Any]
changed_since: bool
pagination: ds_provider_tripletex_py_lib.enums.PaginationKind
explode_columns: list[str] = []
ds_provider_tripletex_py_lib.read_info._load_metadata(product_name: ds_provider_tripletex_py_lib.enums.TripletexProductName, operation: ds_provider_tripletex_py_lib.enums.OperationType) → dict[str, Any][source]

Read and parse one product’s packaged operation metadata.

A plain, mechanical file read – whether a missing file is an error is left to the caller to decide.

Parameters:
  • product_name – Tripletex product whose assets to load.

  • operation – Operation whose metadata file to load.

Returns:

Parsed JSON payload.

Return type:

dict[str, Any]

Raises:

FileNotFoundError – If the product has no packaged assets for that operation.

ds_provider_tripletex_py_lib.read_info.get_read_info(product_name: ds_provider_tripletex_py_lib.enums.TripletexProductName) → ReadInfo[source]

Load packaged read metadata for a Tripletex product.

Every TripletexProductName member must ship read assets, so a missing file is treated the same as a malformed one – a packaging bug, not a condition to degrade gracefully from.

Parameters:

product_name – Tripletex product to load.

Returns:

Read info built from assets/<product_name>/read/metadata.json.

Return type:

ReadInfo

Raises:

ValidationError – If the metadata file is missing, or exists but is missing a required key (path, fields, pagination, changed_since) or pagination is not a recognized PaginationKind value.