reprospect.utils.rich_helpers module

class reprospect.utils.rich_helpers.TableMixinView on GitHub

Bases: object

Define __str__() based on the rich.table.Table representation from to_table().

final __str__() strView on GitHub

Use rich.console.Console in capture mode.

abstractmethod to_table() TableView on GitHub

Convert to a rich.table.Table.

class reprospect.utils.rich_helpers.TreeMixinView on GitHub

Bases: object

Define __str__() based on the rich.tree.Tree representation from to_tree().

final __str__() strView on GitHub

Use rich.console.Console in capture mode.

abstractmethod to_tree() TreeView on GitHub

Convert to a rich.tree.Tree.

reprospect.utils.rich_helpers.df_to_table(df: DataFrame, *, rich_table: Table | None = None, show_index: bool = False, **kwargs) TableView on GitHub

Convert a pandas.DataFrame to a rich.table.Table.

reprospect.utils.rich_helpers.ds_to_table(ds: Series) TableView on GitHub

Convert a pandas.Series to a rich.table.Table.

reprospect.utils.rich_helpers.to_string(ro: Table | Tree, *, width: int = 200, no_wrap: bool = True, **kwargs) strView on GitHub

Use rich.console.Console in capture mode to render a rich object to a string.