Skip to main content
Version: 0.5.4

common.configuration.utils

auto_cast

def auto_cast(value: str) -> Any

[view_source]

Parse and cast str value to bool, int, float and complex (via JSON)

F[f]alse and T[t]rue strings are cast to bool values

auto_config_fragment

def auto_config_fragment(value: str) -> Optional[DictStrAny]

[view_source]

Tries to parse config fragment assuming toml, yaml and json formats

Only dicts are considered valid fragments. None is returned when not a fragment

add_config_to_env

def add_config_to_env(
config: BaseConfiguration, sections: Tuple[str, ...] = ()) -> None

[view_source]

Writes values in configuration back into environment using the naming convention of EnvironProvider. Will descend recursively if embedded BaseConfiguration instances are found

add_config_dict_to_env

def add_config_dict_to_env(dict_: Mapping[str, Any],
sections: Tuple[str, ...] = (),
overwrite_keys: bool = False,
destructure_dicts: bool = True) -> None

[view_source]

Writes values in dict_ back into environment using the naming convention of EnvironProvider. Applies sections if specified. Does not overwrite existing keys by default

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.