birchrest.utils package

Submodules

birchrest.utils.artwork module

birchrest.utils.artwork.get_artwork(host: str, port: int, version: str) str[source]

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.

static info(message: str, obj: Any | None = None) None[source]

Logs an info message with green color.

static warning(message: str, obj: Any | None = None) None[source]

Logs a warning message with yellow 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.

birchrest.utils.get_artwork(host: str, port: int, version: str) str[source]