rich — Rich 14.0.0 documentation (original) (raw)

Rich text and beautiful formatting in the terminal.

rich.get_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, *, console=None, title=None, help=False, methods=False, docs=True, private=False, dunder=False, sort=True, all=False, value=True)[source]

Inspect any Python object.

Parameters:

Return type:

None

rich.print(*objects, sep=' ', end='\n', file=None, flush=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.

Parameters:

Return type:

None

rich.print_json(json=None, *, data=None, indent=2, highlight=True, skip_keys=False, ensure_ascii=False, check_circular=True, allow_nan=True, default=None, sort_keys=False)[source]

Pretty prints JSON. Output will be valid JSON.

Parameters:

Return type:

None

rich.reconfigure(*args, **kwargs)[source]

Reconfigures the global console by replacing it with another.

Parameters:

Return type:

None