A Ruby library for generating plain text tables with a DRY, column-based API and extensive configuration options.
Tabulo is a Ruby library for generating plain text tables, also known as ASCII tables, from any Enumerable data source. It solves the problem of formatting structured data for terminal output, logs, or reports with a clean, column-based API that avoids repetitive code. Developers can quickly create tables with configurable widths, alignment, styling, and borders.
Ruby developers working on CLI applications, Rails console scripts, logging utilities, or any project requiring formatted text output in terminals. It's especially useful for those tabulating database queries, API responses, or other enumerable collections.
Tabulo stands out with its DRY, column-based API that keeps headers and data in sync automatically, reducing errors. It offers extensive customization (wrapping, styling, borders) without sacrificing ease of use, and supports streaming for large datasets—features often missing in alternatives.
Plain text table generator for Ruby, with a DRY, column-based API
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Defines columns once with headers and body rows automatically synchronized, reducing boilerplate and errors. The README emphasizes this as a core philosophy, contrasting with row-based libraries that require manual sync.
Allows fixed widths, auto-sizing via pack to fit terminal limits, and configurable wrapping or truncation. Evidence includes the pack method that adjusts columns without overflowing, as shown in examples.
Automatically aligns cells based on content type—numbers right, strings left—with overrides for headers and body. The README details this with configurable align_header and align_body options.
Enables row-by-row iteration without loading the entire collection, ideal for large datasets. The README demonstrates this with enumerators and find_each for ActiveRecord queries.
Offers styling with ANSI colors, multiple border types (ASCII, Unicode, Markdown), and table transposition. Features like border_styler and transpose are documented with specific examples.
Using a title with the Markdown border type produces invalid Markdown, as the README explicitly warns—this limits its use for documentation without workarounds.
The pack method requires traversing the entire collection upfront to calculate widths, which can be inefficient for very large or dynamic datasets, as noted in the README's caveats.
As a Ruby gem, it's confined to Ruby ecosystems, making it unsuitable for projects in other languages or those requiring lightweight, dependency-free solutions.
While easy for basic use, the extensive API with options like stylers and formatters adds cognitive load compared to minimalist alternatives for trivial table generation.