Configuration¶
import kloch
import kloch.config
A simple configuration system for the Kloch runtime.
- class kloch.config.KlochConfig(launcher_plugins: ~typing.List[str] = <factory>, cli_logging_paths: ~typing.List[~pathlib.Path] = <factory>, cli_logging_format: str = '{levelname: <7} | {asctime} [{name}] {message}', cli_logging_default_level: int | str = 'INFO', cli_session_dir: ~pathlib.Path | None = None, cli_session_dir_lifetime: float = 240.0, profile_roots: ~typing.List[~pathlib.Path] = <factory>)¶
Configure kloch using a simple key/value pair dataclass system.
- classmethod from_environment() KlochConfig ¶
Generate an instance from a serialized file specified in an environment variable.
- classmethod from_file(file_path: Path) KlochConfig ¶
Generate an instance from a serialized file.
- classmethod get_field(field_name: str) Field | None ¶
Return the dataclass field that match the given name else None.
- kloch.config.get_config() KlochConfig ¶
Get the current kloch configuration extracted from the environment.
A default configuration is generated if no configuration file is specified.
- Returns:
a new config instance