Rich Formatting

ictr integrates with the Rich library for beautiful terminal output.

Automatic Detection

If rich is installed, ictr will automatically use it for:

  • Syntax highlighting of data structures

  • Colorful tracebacks

  • Emoji rendering

>>> ictr( 'note', address = 'doctest' )( 'Rich output enabled.' )

>>> # Complex data structures are pretty-printed
>>> data = { 'a': 1, 'b': [ 2, 3 ] }
>>> ictr( 'note', address = 'doctest' )( 'Data:', data )

>>> # Verify output contains the message (may include ANSI color codes)
>>> 'Rich output enabled' in capture.getvalue( )
True