archivebox.config.collection

Module Contents

Classes

CaseConfigParser

PluginConfigSection

Pseudo-section for all plugin config keys written to [PLUGINS] section in ArchiveBox.conf

Functions

get_real_name

get the up-to-date canonical name for a given old alias or current key

load_config_val

parse bool, int, and str key=value pairs from env

load_config_file

load the ini-formatted config file from DATA_DIR/Archivebox.conf

section_for_key

Find the config section containing a given key.

write_config_file

load the ini-formatted config file from DATA_DIR/Archivebox.conf

load_config

load_all_config

Load all config sections and return as a flat dict.

API

class archivebox.config.collection.CaseConfigParser(defaults=None, dict_type=_default_dict, allow_no_value=False, *, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=DEFAULTSECT, interpolation=_UNSET, converters=_UNSET)[source]

Bases: configparser.ConfigParser

optionxform(optionstr: str) str[source]
archivebox.config.collection.get_real_name(key: str) str[source]

get the up-to-date canonical name for a given old alias or current key

archivebox.config.collection.load_config_val(key: str, default: Any = None, type: archivebox.config.collection.load_config_val.type | None = None, aliases: tuple[str, ...] | None = None, config: benedict.benedict | None = None, env_vars: os._Environ | None = None, config_file_vars: dict[str, str] | None = None) Any[source]

parse bool, int, and str key=value pairs from env

archivebox.config.collection.load_config_file() benedict.benedict | None[source]

load the ini-formatted config file from DATA_DIR/Archivebox.conf

class archivebox.config.collection.PluginConfigSection(key: str)[source]

Pseudo-section for all plugin config keys written to [PLUGINS] section in ArchiveBox.conf

Initialization

toml_section_header[source]

‘PLUGINS’

__getattr__(name: str) Any[source]
update_in_place(warn: bool = True, persist: bool = False, **kwargs)[source]

No-op update since plugins read config dynamically via get_config().

archivebox.config.collection.section_for_key(key: str) Any[source]

Find the config section containing a given key.

archivebox.config.collection.write_config_file(config: dict[str, str]) benedict.benedict[source]

load the ini-formatted config file from DATA_DIR/Archivebox.conf

archivebox.config.collection.load_config(defaults: dict[str, Any], config: benedict.benedict | None = None, out_dir: str | None = None, env_vars: os._Environ | None = None, config_file_vars: dict[str, str] | None = None) benedict.benedict[source]
archivebox.config.collection.load_all_config()[source]

Load all config sections and return as a flat dict.