config#
- default_config_values() dict[str, Any]#
- class Config(initialize: bool = True)#
Bases:
object- init() None#
- dump(file: IO[Any]) None#
- snapshot() dict[str, Any]#
- serialize() str#
- getoption(name: str, default: Any = None) Any#
- get(path: str, default: Any = None) Any#
- add_section(name: str, schema: Schema) None#
- set(path: str, value: Any) None#
- write_new(path: str, value: Any, scope: Literal['site', 'global', 'local']) None#
- set_main_options(args: Namespace) None#
Set main configuration options based on command-line arguments.
Updates the configuration attributes based on the provided argparse Namespace containing command-line arguments.
- Parameters:
args – An argparse.Namespace object containing command-line arguments.
- apply_environment_mods(envmods: dict[str, Any]) None#
Apply modifications to the environment
Warning
This modifies os.environ for the entire process
- create_scope(name: str, file: str | None, data: dict[str, Any]) None#
- get_config_scope_data(scope: Literal['site', 'global', 'local']) dict[str, Any]#
Read the data from config scope
dataBy the time the data leaves, it is validated and does not contain a top-level
canaryfield
- read_config_file(file: str | Path) dict[str, Any] | None#
Load configuration settings from
file
- get_scope_filename(scope: str) Path#
- get_env_scope() dict[str, Any]#
- process_config_path(path: str) list[str]#
- isnullpath(path: str) bool#
- boolean(arg: Any) bool#
- expandvars(arg: Any, mapping: dict) Any#
- exception LocalScopeDoesNotExistError#
Bases:
Exception