rich.protocol

rich.protocol.is_renderable(check_object)[source]

Check if an object may be rendered by Rich.

Parameters:

check_object (Any)

Return type:

bool

rich.protocol.rich_cast(renderable)[source]

Cast an object to a renderable by calling __rich__ if present.

Parameters:

renderable (object) – A potentially renderable object

Returns:

The result of recursively calling __rich__.

Return type:

object