tabitha is a no-frills tabular formatter for the terminal.

tabitha

tabitha is a no-frills tabular formatter for the terminal.

Apache 2.0 License Go Version Go Build Go Report Card

Features

  • Supports padding output to the longest display text, honoring ANSI colors
  • Simple API to add a single header and 0..n lines
  • Add "spacer" lines anywhere in the table. Character output is automatically calculated based on width of other text.
  • Customize line separator, padding character, disable padding or honoring ansi

Build/Test

go test -v -race -cover ./...

Example

The following example demonstrates usage (sans error handling).

tt := tabitha.NewWriter()
tt.Header("First", "Second", "Third", "Fourth")
tt.SpacerLine()
tt.AddLine("I'm first", "I'm second", "I'm third", "I'm fourth")
tt.SpacerLine()
tt.WriteTo(os.Stdout)

Why not text/tabwriter?

This is a little different from text/tabwriter; a main difference being that tabwriter assumes all runes are the same size and includes ANSI codes in width calculations while tabitha does not.

In tabitha, rune width is evaluated using utf8.RuneCountInString. When ANSI support is enabled, tabitha will extract non-ANSI text (the "displayable text") using regex. Since tabitha collects all tabular text before writing out to a target io.Writer, it is not expected to perform as well as tabwriter.

License

This project is licensed under Apache 2.0.

Owner
Jim Schubert
Core team and founding member of OpenAPI Generator. C#, Kotlin, Scala Java, JavaScript
Jim Schubert
Similar Resources

Terminal stock ticker with live updates and position tracking

Terminal stock ticker with live updates and position tracking

Ticker Terminal stock watcher and stock position tracker Features Live stock price quotes Track value of your stock positions Support for multiple cos

Jan 8, 2023

lazyhub - Terminal UI Client for GitHub using gocui.

lazyhub - Terminal UI Client for GitHub using gocui.

lazyhub - Terminal UI Client for GitHub using gocui.

Dec 14, 2022

A modern and intuitive terminal-based text editor

A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals

Jan 7, 2023

Pi-hole data right from your terminal. Live updating view, query history extraction and more!

Pi-hole data right from your terminal. Live updating view, query history extraction and more!

Pi-CLI Pi-CLI is a command line program used to view data from a Pi-Hole instance directly in your terminal.

Dec 12, 2022

💻 PTerm | Pretty Terminal Printer A golang module to print pretty text

💻 PTerm | Pretty Terminal Printer A golang module to print pretty text

✨ PTerm is a modern go module to beautify console output. Featuring charts, progressbars, tables, trees, and many more 🚀 It's completely configurable and 100% cross-platform compatible.

Jan 1, 2023

A collection of terminal-based widgets for richer Golang CLI apps.

A collection of terminal-based widgets for richer Golang CLI apps.

Flinch A collection of terminal-based widgets for richer Golang CLI apps. Ships with a library to build your own widgets/TUIs too. Warning: This modul

Jan 7, 2023

A wrapper around cd and xdg-open to use aliases to directory paths in terminal

CDD - Change directories Dynamically I am a lazy linux user and turns out that basic tab completion wasn't enough for me to navigate through my direct

Dec 15, 2022

Terminal multiplexer inspired by i3

3mux is a terminal multiplexer with out-of-the-box support for search, mouse-controlled scrollback, and i3-like keybindings. Imagine tmux with a small

Dec 28, 2022

A simple terminal UI for Go linters

A simple terminal UI for Go linters

golintui golintui is a TUI tool that helps you run various kinds of linters with ease and organize its results, with the power of golangci-lint. Cool

Jun 9, 2022
Related tags
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.

Stonks is a terminal based stock visualizer and tracker. Installation Requirements: golang >= 1.13 Manual Clone the repo Run make && make install Pack

Dec 16, 2022
Terminal client for SimpleNote

GoNote - Terminal client for SimpleNote GoNote is a simple utility for managing notes in your SimpleNote account. It allows basic operations like crea

Nov 22, 2022
gomerge is a tool to quickly bulk merge several pull requests from your terminal.
gomerge is a tool to quickly bulk merge several pull requests from your terminal.

Gomerge is a tool to quickly enable you to bulk merge Github pull requests from your terminal. The intention of this tool is to simplfy, and eventually automate the merging of github pull requests. This tool should be able to run on most systems.

Dec 28, 2022
`tmax` is a powerful tool to help you get terminal cmd directly.
`tmax`  is a powerful tool to help you get terminal cmd directly.

The positioning of tmax is a command line tool with a little artificial intelligence. If you frequently deal with the terminal daily, tmax will greatly improve your work efficiency.

Oct 15, 2022
YouTube client on your terminal

MeowTube YouTube client on your terminal Table of Contents About Getting Started Usage Contributing About MeowTube is a CLI (Command Line Interface) t

Jul 29, 2022
🎄 A Christmas tree right from your terminal!
🎄 A Christmas tree right from your terminal!

ctree ?? A Christmas tree right from your terminal! ?? Demo ⌛ No Refresh Don't want the tree to refresh every 2 seconds? Easy! Just add the --no-refre

Dec 20, 2022
progress_bar creates a single customizable progress bar for Linux terminal.
progress_bar creates a single customizable progress bar for Linux terminal.

progress_bar Go Progress Bar Features progress_bar creates a single customizable progress bar for Linux terminal. Installation go get -u github.com/er

Aug 12, 2022
A terminal based typing test.
A terminal based typing test.

What A terminal based typing test. Installation Linux sudo curl -L https://github.com/lemnos/tt/releases/download/v0.4.0/tt-linux -o /usr/local/bin/tt

Dec 28, 2022
Raspberry Pi terminal based activity monitor
Raspberry Pi terminal based activity monitor

pitop Raspberry Pi terminal based activity monitor Yes I know there are plenty of solutions already available, but I wanted to build my own terminal b

Dec 11, 2022
❓🖼 Find the anime scene by image using your terminal
❓🖼 Find the anime scene by image using your terminal

What Anime CLI ❓ ?? > This application is basically a ?? wrapper around trace.moe PREVIEW Usage ?? Get Anime By Image File ?? what-anime file anime.jp

Jan 2, 2023