aeat.domain.calculations.registry._temporal module

Temporal selection for registry-backed modelo revisions.

Selects exactly one ModeloRevision from a ModeloDefinition given a filing year, period, and optional date constraint.

select_revision(modelo, *, filing_year, period, on=None, revision_id=None)[source]

Select exactly one ModeloRevision for a filing period.

Parameters:
  • modelo (ModeloDefinition) – The ModeloDefinition to select a revision from.

  • filing_year (int) – AEAT filing year used to narrow revisions by period_selector.

  • period (str) – Period token (e.g. "1T", "0A", "ALTA"); case-insensitive against the revision’s declared periods.

  • on (date | None) – Optional reference date that must fall within the revision’s valid_from / valid_to window.

  • revision_id (str | None) – Optional explicit revision id; restricts candidates to the matching revision when supplied.

Return type:

ModeloRevision