rich

Rich text and beautiful formatting in the terminal.

rich.get_console() → Console[source]

Get a global Console instance. This function is used when Rich requires a Console, and hasn’t been explicitly given one.

Returns

A console instance.

Return type

Console

rich.inspect(obj: Any, *, console: Console = None, title: str = None, help: bool = False, methods: bool = False, docs: bool = True, private: bool = False, dunder: bool = False, sort: bool = True, all: bool = False)[source]

Inspect any Python object.

Parameters
  • obj (Any) – An object to inspect.

  • title (str, optional) – Title to display over inspect result, or None use type. Defaults to None.

  • help (bool, optional) – Show full help text rather than just first paragraph. Defaults to False.

  • methods (bool, optional) – Enable inspection of callables. Defaults to False.

  • docs (bool, optional) – Also render doc strings. Defaults to True.

  • private (bool, optional) – Show private attributes (beginning with underscore). Defaults to False.

  • dunder (bool, optional) – Show attributes starting with double underscore. Defaults to False.

  • sort (bool, optional) – Sort attributes alphabetically. Defaults to True.

  • all (bool, optional) – Show all attributes. Defaults to False.

rich.print(*objects: Any, sep=' ', end='\n', file: IO[str] = None, flush: bool = False)[source]
Print object(s) supplied via positional arguments. This function has an identical signature

to the built-in print. For more advanced features, see the Console class.

Args:

sep (str, optional): Separator between printed objects. Defaults to ” “. end (str, optional): Character to write at end of output. Defaults to “

“.

file (IO[str], optional): File to write to, or None for stdout. Defaults to None. flush (bool, optional): Has no effect as Rich always flushes output.. Defaults to False.