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

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

#124 in Value formatting

Download history 197/week @ 2024-09-07 324/week @ 2024-09-14 54/week @ 2024-09-21 26/week @ 2024-09-28 1/week @ 2024-10-05 3/week @ 2024-10-12

97 downloads per month

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

~230–680KB
~16K SLoC