aeat.core.topics package¶
Conceptual topic catalogue for aeat app registry citations.
A tax-naive operator hitting the CLI for the first time needs
plain-language explanations of concepts (iva-regime, casilla,
pago-fraccionado …) without having to leave the terminal. The
CLI exposes:
aeat app registry citations-> list every registered slug + one-line summary.aeat app registry citations <slug>-> render the topic body + see_also pointers + legal references.
Topics live as TOML files under registry/aeat/topics/<slug>.toml;
title and body text live in the i18n catalogue under topic.<slug>.*
so translations follow the project’s locale pipeline rather than
hardcoded multiline strings.
The Topic records are core-level resources: they depend only
on core primitives and the bundled registry path. They are loaded into
a TopicCatalogue by load_topic_catalogue() and consumed
through the
core.resources._repos.topics.TopicCatalogueRepository
singleton, keeping core free of any import into the application
layer.
- exception TopicNotFoundError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorRaised when a requested slug is absent from a
TopicCatalogue.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- class Topic(**data)[source]¶
Bases:
BaseModelOne conceptual topic.
- Variables:
slug – Stable kebab-case identifier (
iva-regime).title_key – i18n key resolving to the topic’s human-readable title. Convention:
topic.<slug>.title.body_key – i18n key resolving to the topic body. Convention:
topic.<slug>.body.see_also – Slugs of related topics for cross-referencing.
legal_refs – Stable corpus references (
ley-58-2003:art-27.2,rd-439-2007:art-110) the topic anchors against.
- Parameters:
- slug: str¶
- title_key: str¶
- body_key: str¶
- see_also: tuple[str, ...]¶
- legal_refs: tuple[str, ...]¶
- class TopicCatalogue(**data)[source]¶
Bases:
BaseModelClosed catalogue of registered
Topicrecords.- topics: tuple[Topic, ...]¶
- load_topic_catalogue(root=None)[source]¶
Load every
registry/aeat/topics/<slug>.tomlinto one catalogue.- Parameters:
root (
Path|None) – Override directory (defaults to the canonical project registry path).- Return type:
- Returns:
A
TopicCataloguecarrying oneTopicper TOML.