#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

#507 in Text processing

Download history 505/week @ 2024-09-12 62/week @ 2024-09-19 30/week @ 2024-09-26 5/week @ 2024-10-03

602 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

~260–710KB
~17K SLoC