Home

Awesome

tabl

Make tables from data in your terminal.

Install

Download the latest from the releases page.

Usage

This small utility takes JSON or EDN files with multiple maps and creates a table for ease of viewing. For example:

$ cat test.json
{"foo":"bar","baz":4}
{"foo":"oof","baz":4}
$ cat test.json | tabl -j
 :baz | :foo
------|------
 4    | bar
 4    | oof

There are several table rendering modes available:

librarymodes
fancyfancy
doricorg, csv, html, raw
built-inmd, k8s
$ cat test.json | tabl -j -m org
|-----+-----|
| Foo | Baz |
|-----+-----|
| bar | 4   |
| oof | 4   |
|-----+-----|

Babashka pod support

The following namespaces and functions are exposed via the pod interface:

Example:

#!/usr/bin/env bb

(require '[babashka.pods :as pods])
(pods/load-pod "tabl")

(require '[pod.tabl.fancy :as fancy])
(require '[pod.tabl.doric :as doric])

;;
(fancy/print-table [{:foo 1 :bar 2} {:foo 2 :bar 3}])
(doric/print-table [{:foo 1 :bar 2} {:foo 2 :bar 3}])
(doric/print-table {:format 'doric.org} [{:foo 1 :bar 2} {:foo 2 :bar 3}])

See pod_test.clj for more examples.

Development

Not quite ready yet. This depends on a soon-to-be-released library.

Thank you to Michiel Borkent and Lee Read for spearheading the GraalVM efforts, documented here.

License

Copyright © 2019-2022 Nate Jones

Distributed under the EPL License. See LICENSE.

This project contains code from:

babashka, which is licensed under the same EPL License.