Skip to content

Config

Config file.

======================================================================================================================== Name: pymodeller/config.py Description: Load configuration. Project: PyModeller

Classes:

Name Description
CodegenConfig

Main configuration model for code generation.

DestinationConfig

Output path configuration for a specific model type (e.g., infrastructure, domain).

SourceType

Source type.

Functions:

Name Description
get_code_gen_config

Retrieve and instantiate cached code generation configuration.

CodegenConfig

Bases: BaseSettings

Main configuration model for code generation.

Methods:

Name Description
get_destination

Retrieve destination paths for a given model type with resolved base paths.

get_destinations

Get dict of detinations.

parse_enabled_sources

Parse 'yaml,s3' string from TOML into list of SourceType.

settings_customise_sources

Customizes the configuration loading order for settings.

get_destination

get_destination(
    model_type: DestinationType = INFRASTRUCTURE,
) -> DestinationConfig

Retrieve destination paths for a given model type with resolved base paths.

get_destinations

get_destinations(
    model_type: DestinationType | None = INFRASTRUCTURE,
) -> dict[DestinationType, DestinationConfig]

Get dict of detinations.

parse_enabled_sources classmethod

parse_enabled_sources(v: Any) -> Any

Parse 'yaml,s3' string from TOML into list of SourceType.

settings_customise_sources classmethod

settings_customise_sources(
    settings_cls: type[BaseSettings],
    init_settings: PydanticBaseSettingsSource,
    env_settings: PydanticBaseSettingsSource,
    dotenv_settings: PydanticBaseSettingsSource,
    file_secret_settings: PydanticBaseSettingsSource,
) -> tuple[PydanticBaseSettingsSource, ...]

Customizes the configuration loading order for settings.

Prioritizes constructor arguments (init_settings) first, followed by values parsed from the pyproject.toml file source.

DestinationConfig

Bases: BaseModel

Output path configuration for a specific model type (e.g., infrastructure, domain).

Methods:

Name Description
resolve_paths

Resolve relative paths by prepending the project base directory.

resolve_paths

resolve_paths(
    base_dir: Path,
    test_dir: Path,
    destination_type: DestinationType,
) -> DestinationConfig

Resolve relative paths by prepending the project base directory.

SourceType

Bases: StrEnum

Source type.

get_code_gen_config cached

get_code_gen_config() -> CodegenConfig

Retrieve and instantiate cached code generation configuration.