Skip to content

Loader

Env-spec loader.

======================================================================================================================== Name: core/env/loader.py Description: Parses env_data_model.yaml into typed Python dataclasses that represent every environment variable defined for the project.

Classes:

Name Description
DBField

Configuración específica para entrada.

DBSpec

Configuración específica para Peewee/DB.

EnvSection

A named group of environment variables.

EnvSpec

Full specification parsed from the YAML file.

EnvVarSpec

Specification for a single environment variable.

SectionType

Section type.

Functions:

Name Description
load_env_spec

Load and parse the env_spec YAML file.

DBField dataclass

Configuración específica para entrada.

DBSpec dataclass

Configuración específica para Peewee/DB.

EnvSection dataclass

A named group of environment variables.

EnvSpec dataclass

Full specification parsed from the YAML file.

Methods:

Name Description
validate_no_duplicates

Ensure no collisions between environment names or Python aliases.

Attributes:

Name Type Description
all_vars list[EnvVarSpec]

Flat list of all variable specifications.

all_vars property

all_vars: list[EnvVarSpec]

Flat list of all variable specifications.

validate_no_duplicates

validate_no_duplicates() -> None

Ensure no collisions between environment names or Python aliases.

EnvVarSpec dataclass

Specification for a single environment variable.

Methods:

Name Description
display_value

Return a masked or real default value for documentation purposes.

display_value

display_value() -> str

Return a masked or real default value for documentation purposes.

SectionType

Bases: StrEnum

Section type.

load_env_spec

load_env_spec(path: str | Path | None = None) -> EnvSpec

Load and parse the env_spec YAML file.