tableview

Interactive table viewer for the terminal

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install tableview
choosenim install tableview
git clone https://www.github.com/telatin/tabview

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
tableview - - - - - - -

Source

Repository https://www.github.com/telatin/tabview
Homepage https://telatin.github.io/tabview
Registry Source nimble_official

README

tableview

CI pages-build-deployment

A Nim library for interactive TUI table viewing, with two demo binaries bundled. Other tools can embed the viewer by importing tableview and calling viewTable or viewTabularFile.

Screenshot

Library API

import tableview

# View an in-memory table (e.g. output of your own tool)
viewTable(data: TableData, schemeName = "default", filename = "", hasHeader = true)

# View a file or stdin ("-")
viewTabularFile(path: string, schemeName = "default", delimiter = '\0',
                skipLines = 0, skipPrefix = "", hasHeader = true, maxColWidth = 20)

Building a TableData yourself

import tableview

var data = TableData(
  headers:      @["Name", "Score", "Grade"],
  rows:         @[@["Alice", "95", "A"], @["Bob", "82", "B"]],
  columnWidths: @[5, 5, 5],          # will be expanded as needed
  columnTypes:  @[ctString, ctInt, ctString],
  hiddenColumns: @[false, false, false]
)

viewTable(data, filename = "my tool output")

Example: tool with optional --view-table flag

import tableview

# ... build `data: TableData` from your tool's output ...

if opts.viewTable:
  viewTable(data, filename = "my-tool")
else:
  for row in data.rows:
    echo row.join("\t")

Binaries

tableview — view TSV/CSV files

nimble build
./bin/tableview <file.tsv|file.csv>
./bin/tableview -                      # read from stdin
cat data.csv | ./bin/tableview -

Options:

Flag Description
-t, --tsv Force tab-separated parsing
-c, --csv Force comma-separated parsing
--noheader Treat first row as data, generate Col1/Col2… headers
-w N, --maxwidth N Maximum column display width (default: 20)
-s NAME, --scheme NAME Color scheme (default, bold, subtle, dark, mono, …)
--skip N Skip first N lines before parsing
--skip-prefix STR Skip lines starting with STR

wordcount — count lines, words and characters (library demo)

./bin/wordcount file1.txt file2.txt    # print table to stdout
./bin/wordcount -s file1.txt file2.txt # include TOTAL row
./bin/wordcount -t file1.txt file2.txt # open interactive viewer
./bin/wordcount - < file.txt           # read from stdin

Options:

Flag Description
-t, --table Open results interactively with viewTable
-s, --summary-row Add a TOTAL row when multiple files are given

Keyboard Controls

Key Action
/k, /j Move up / down one row
, Move left / right one column
Page Up/Page Down Scroll one page
Home / End Jump to first / last row
/ Search across all columns
\| Search within active column
& Filter rows (keep matches)
n / b Next / previous search match
r Toggle regex search mode
:N + Enter Jump to row N
[ / ] Sort active column ascending / descending
g Graph view: value frequencies for active column
h / u Hide active column / unhide all columns
p / o Widen / narrow active column
f then r/c/u Freeze rows / cols / unfreeze
t Toggle header row
s Save visible table to file (TSV or CSV by extension)
Tab Cycle color schemes
q / Q Quit

Building

nimble build        # produces bin/tableview and bin/wordcount

Dependencies

  • nimwave — TUI rendering framework
  • illwave — low-level terminal library
  • argparse — command-line argument parsing