arbor_imago.utils package

Module contents

arbor_imago.utils.deep_merge_dicts(primary_dict: dict, secondary_dict: dict) dict[source]

Recursive dict merge. Inspired by :meth:dict.update(), instead of updating only top-level keys, dict_merge recurses down into dicts nested to an arbitrary depth, updating keys. The secondary_dict is merged into primary_dict. :param primary_dict: dict onto which the merge is executed :param secondary_dict: primary_dict merged into primary_dict :return: None

arbor_imago.utils.generate_jwt_secret_key() str[source]
arbor_imago.utils.generate_uuid() str[source]
arbor_imago.utils.hash_password(password: str) str[source]
arbor_imago.utils.load_dict_from_file(config_path: Path) dict[source]
arbor_imago.utils.resolve_path(root_dir: Path, path: str | PathLike[str]) Path[source]

Resolve a path to absolute, using root_dir for relative paths.

arbor_imago.utils.verify_password(plain_password: str, hashed_password: str) bool[source]
arbor_imago.utils.write_dict_to_file(config: dict, config_path: Path) None[source]

Write a dictionary to a file in JSON, YAML, TOML, or INI format based on file extension.