aeat.domain.categories._registry module

Read-only spending-category profile registry.

load_category_profile_registry() reads committed TOML profile files into immutable mappings from SpendingCategory to CategoryProfile; resolve_category_profiles() selects the exact year registry used by classification and filing review surfaces.

load_category_profile_file(path)[source]

Load one year-keyed spending-category profile TOML file.

Return type:

Mapping[SpendingCategory, CategoryProfile]

Returns:

Mapping from SpendingCategory to CategoryProfile for the file’s year.

Parameters:

path (Path)

load_category_profile_registry(root=None)[source]

Load every committed year-keyed spending-category profile registry.

Resolves the bundled categories root on every call when no override is supplied; the bundled_path boundary is the single resolution surface.

Return type:

Mapping[int, Mapping[SpendingCategory, CategoryProfile]]

Returns:

Mapping from year to a per-year mapping from SpendingCategory to CategoryProfile.

Parameters:

root (Path | None)

resolve_category_profiles(year)[source]

Return the exact category profile registry for year.

Return type:

Mapping[SpendingCategory, CategoryProfile]

Returns:

Mapping from SpendingCategory to CategoryProfile for year.

Parameters:

year (int)