utils¶
Utilities for the application.
General utility functions.
- src.utils.camel_case(string: str) str [source]¶
Convert a string to camel case.
- Parameters:
string – The string to convert.
- Returns:
The camel cased string.
- src.utils.case_insensitive_string_compare(a: str, b: str, /) bool [source]¶
Compare two strings case insensitively.
- Parameters:
a – The first string.
b – The second string.
- Returns:
Whether the strings are equal.
- src.utils.dataclass_as_dict_shallow(dataclass: Any, *, exclude_none: bool = False) dict[str, Any] [source]¶
Convert a dataclass to a dict.
- Parameters:
dataclass – The dataclass to convert.
exclude_none – Whether to exclude None values.
- Returns:
The dataclass as a dict.
- src.utils.import_string(dotted_path: str) Any [source]¶
Import a class/function from a dotted path.
- Parameters:
dotted_path – The dotted path to the class/function.
- Returns:
The imported class/function.