typeddfs.utils.parse_utils
ο
Misc tools for typed-dfs.
Module Contentsο
- class typeddfs.utils.parse_utils.ParseUtilsο
- classmethod _re_leaf(cls, at: str, items: Mapping[str, Any]) Generator[Tuple[str, Any], None, None] ο
- classmethod _un_leaf(cls, to: MutableMapping[str, Any], items: Mapping[str, Any]) None ο
- classmethod dict_to_dots(cls, 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(cls, 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(cls, items: Mapping[str, Any]) Mapping[str, Any] ο
Make sub-dictionaries from substrings in
items
delimited by.
. Used for TOML.Example
Utils.dots_to_dict({"genus.species": "fruit bat"}) == {"genus": {"species": "fruit bat"}}
See also
- classmethod property_key_escape(cls, s: str) str ο
Escapes a key in a .property file.
- classmethod property_key_unescape(cls, s: str) str ο
Un-escapes a key in a .property file.
- classmethod property_value_escape(cls, s: str) str ο
Escapes a value in a .property file.
- classmethod property_value_unescape(cls, s: str) str ο
Un-escapes a value in a .property file.
- classmethod strip_control_chars(cls, s: str) str ο
Strips all characters under the Unicode βCcβ category.