qrunch.common.printing_util

Module that include printing utilities.

Functions

class_summary(**kwargs)

Print a summary of class.

dataclass_to_string(obj[, exclude])

Recursively convert dataclass object to a dictionary, including nested dataclasses.

input_summary(**kwargs)

Print the input arguments as a string.

summarize_value(value)

Recursively summarize a value into a string.

class_summary(**kwargs: Any) str

Print a summary of class.

Parameters:

**kwargs (Any) – Keyword arguments passed to the function.

Return type:

str

dataclass_to_string(obj: Any, exclude: list[str] | None = None) str

Recursively convert dataclass object to a dictionary, including nested dataclasses.

Parameters:
  • obj (Any) – The dataclass object to convert.

  • exclude (list[str] | None) – List of attribute names to exclude from the string.

Return type:

str

input_summary(**kwargs: Any) str

Print the input arguments as a string.

Parameters:

**kwargs (Any) – Keyword arguments passed to the function.

Return type:

str

summarize_value(value: Any) str

Recursively summarize a value into a string.

The handling includes dataclasses, dictionaries, lists, and tuples.

Parameters:

value (Any) – The value to summarize.

Return type:

str