birchrest.utils package
Submodules
birchrest.utils.artwork module
Module contents
- class birchrest.utils.Logger[source]
Bases:
object- static debug(message: str, obj: Any | None = None) None[source]
Logs a debug message with blue color.
- static error(message: str, obj: Any | None = None) None[source]
Logs an error message with red color.
- birchrest.utils.dict_to_dataclass(base_name: str, data: Dict[Any, Any] | List[Any]) Any[source]
Converts a dictionary (or list of dictionaries) into a dataclass with fields matching the dictionary keys and values. Handles nested dictionaries and lists of dictionaries by recursively creating dataclasses for them.
- Parameters:
base_name (str): The base name for the generated dataclass. data (dict or list): The dictionary (or list of dictionaries) to convert into a dataclass.
- Returns:
An instance of the generated dataclass populated with the dictionary (or list) data.