mdg.tools package
Submodules
mdg.tools.case module
String convert functions
- mdg.tools.case.alphanumcase(string: str) str [source]
Cuts all non-alphanumeric symbols, i.e. cuts all expect except 0-9, a-z and A-Z.
- Args:
string: String to convert.
- Returns:
string: String with cutted non-alphanumeric symbols.
- mdg.tools.case.backslashcase(string: str) str [source]
Convert string into spinal case. Join punctuation with backslash.
- Args:
string: String to convert.
- Returns:
string: Spinal cased string.
- mdg.tools.case.capitalcase(string: str) str [source]
Convert string into capital case. First letters will be uppercase.
- Args:
string: String to convert.
- Returns:
string: Capital case string.
- mdg.tools.case.constcase(string: str) str [source]
Convert string into upper snake case. Join punctuation with underscore and convert letters into uppercase.
- Args:
string: String to convert.
- Returns:
string: Const cased string.
- mdg.tools.case.dotcase(string: str) str [source]
Convert string into dot case. Join punctuation with dot.
- Args:
string: String to convert.
- Returns:
string: Dot cased string.
- mdg.tools.case.lowercase(string: str) str [source]
Convert string into lower case.
- Args:
string: String to convert.
- Returns:
string: Lowercase case string.
- mdg.tools.case.pascalcase(string: str) str [source]
Convert string into pascal case.
- Args:
string: String to convert.
- Returns:
string: Pascal case string.
- mdg.tools.case.pathcase(string: str) str [source]
Convert string into path case. Join punctuation with slash.
- Args:
string: String to convert.
- Returns:
string: Path cased string.
- mdg.tools.case.sentencecase(string: str) str [source]
Convert string into sentence case. First letter capped and each punctuations are joined with space.
- Args:
string: String to convert.
- Returns:
string: Sentence cased string.
- mdg.tools.case.spinalcase(string: str) str [source]
Convert string into spinal case. Join punctuation with hyphen.
- Args:
string: String to convert.
- Returns:
string: Spinal cased string.
- mdg.tools.case.titlecase(string: str) str [source]
Convert string into sentence case. First letter capped while each punctuations is capitalsed and joined with space.
- Args:
string: String to convert.
- Returns:
string: Title cased string.
mdg.tools.filters module
mdg.tools.io module
- mdg.tools.io.dict_to_obj_pass1(input: dict, base_object_class, references: dict = {}) Tuple[Any, dict] [source]
Creates objects from input dictionary. Pass 1 keeps references and compiles a list of objects with ids used in pass 2.