config#

class Config(export: bool = False)#

Bases: object

get(key: str, default: Any = None) Any#
validate(data: dict[str, Any]) dict[str, Any]#
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.

set(path: str, value: Any) None#

Set the configuration value using yaml-like syntax for path.

Examples:

>>> config = Config()
>>> config.set("backend:default_options", ["--account=ABC123"])
backend(name: str) dict[str, Any] | None#
export() str#
get_config_scope_data(scope: Literal['site', 'global', 'local']) dict[str, Any]#

Read the data from config scope data

By the time the data leaves, it is validated and does not contain a top-level canary field

get_scope_filename(scope: str) str | None#
read_config_file(file: str) dict[str, Any] | None#

Load configuration settings from file

process_config_path(path: str) list[str]#
get_config(export: bool = False) Config#
export() str#
reset() None#