aeat.domain.user_profile._loader module

Read-only loader for the centralized user-profile schema TOML.

load_user_profile_schema() reads the bundled schema TOML into a ProfileSchemaDefinition and raises UserProfileSchemaLoadError when the file cannot be read or validated.

load_user_profile_schema(path=None)[source]

Load the centralized user-profile schema.

Parameters:

path (Path | None) – TOML schema path. Defaults to the bundled registry schema.

Return type:

ProfileSchemaDefinition

Returns:

A strict, frozen ProfileSchemaDefinition.

Raises:

UserProfileSchemaLoadError – If the schema file cannot be stated, parsed, or validated into ProfileSchemaDefinition.