#table #printing #data #debugging #bare-bones #automatic #style

kitty_table

Very small and barebones library for printing tables of data

3 stable releases

1.1.0 Sep 14, 2024
1.0.1 Sep 13, 2024

#706 in Text processing

MIT license

22KB
385 lines

Kitty Table

This tiny library adds methods for printing organized tables of information for debugging.

Formatter

To begin printing tables, a TableFormatter should be created either using new or from_style. The former will create a new formatter from scratch, allowing you to supply an array of [Column]s which dictate how the table will be printed. The latter will automatically fill in the table's style information if your data implements DefaultTableStyle.

Printing

To actually print results using a created TableFormatter, write, debug_write, print, and debug_print may be used. They require a collection of data that implements either DisplayTableRow or DebugTableRow to work.

Notes

DebugTableRow and DefaultTableStyle may be derived— see their documentation for more information about requirements, and about types they are automatically implemented on.

Further explanation

The examples folder shows off a few practical, annotated examples of tables being created. It may be beneficial to check them out!

Dependencies

~245–690KB
~17K SLoC