typeddfs.utils.parse_utilsο
Misc tools for typed-dfs.
Module Contentsο
- class typeddfs.utils.parse_utils.ParseUtilsο
- classmethod _re_leaf(at: str, items: Mapping[str, Any]) Generator[Tuple[str, Any], None, None]ο
- classmethod _un_leaf(to: MutableMapping[str, Any], items: Mapping[str, Any]) Noneο
- classmethod dict_to_dots(items: Mapping[str, Any]) Mapping[str, Any]ο
Performs the inverse of
dots_to_dict().Example
Utils.dict_to_dots({"genus": {"species": "fruit bat"}}) == {"genus.species": "fruit bat"}
- classmethod dicts_to_toml_aot(dicts: Sequence[Mapping[str, Any]])ο
Make a tomlkit Document consisting of an array of tables (βAOTβ).
- Parameters
dicts β A sequence of dictionaries
- Returns
//github.com/sdispater/tomlkit/blob/master/tomlkit/items.py>`_ (i.e.
[[array]])- Return type
A tomlkit`AoT<https
- classmethod dots_to_dict(items: Mapping[str, Any]) Mapping[str, Any]ο
Make sub-dictionaries from substrings in
itemsdelimited by.. Used for TOML.Example
Utils.dots_to_dict({"genus.species": "fruit bat"}) == {"genus": {"species": "fruit bat"}}See also
- classmethod property_key_escape(s: str) strο
Escapes a key in a .property file.
- classmethod property_key_unescape(s: str) strο
Un-escapes a key in a .property file.
- classmethod property_value_escape(s: str) strο
Escapes a value in a .property file.
- classmethod property_value_unescape(s: str) strο
Un-escapes a value in a .property file.
- classmethod strip_control_chars(s: str) strο
Strips all characters under the Unicode βCcβ category.