duras/tbls
1
0
Fork
You've already forked tbls
0
Pure OCaml library for rendering tabular data https://ocaml.org/p/tbls/latest
  • OCaml 99.2%
  • Dune 0.8%
2026年06月17日 11:40:32 +03:00
bin v0.4.0 2026年06月16日 22:03:07 +03:00
demo v0.4.0 2026年06月16日 22:03:07 +03:00
lib v0.4.0 2026年06月16日 22:17:01 +03:00
man fix CHANGES.md format for dune-release 2026年06月17日 10:08:03 +03:00
test v0.4.0 2026年06月16日 22:03:07 +03:00
.gitignore v0.4.0 2026年06月16日 21:37:13 +03:00
.ocamlformat v0.4.0 2026年06月16日 22:03:07 +03:00
CHANGES.md fix CHANGES.md format for dune-release 2026年06月17日 10:08:03 +03:00
dune-project add generated tbls.opam 2026年06月17日 10:42:34 +03:00
EXAMPLES.md v0.4.0 2026年06月17日 11:40:32 +03:00
LICENSE v0.4.0 2026年06月16日 22:03:07 +03:00
README.md Update README.md 2026年06月16日 21:18:40 +02:00
tbls.opam add generated tbls.opam 2026年06月17日 10:42:34 +03:00

tbls

License

Pure OCaml library for rendering tabular data to plain text, Markdown, or HTML.

Accepts typed column descriptors or raw string rows, infers integer and float columns, right-aligns numeric values, and returns a string.

No runtime dependencies.

Installation

opam install tbls

Add to your dune file:

(libraries tbls)

Quick start

open Tbls
let () =
 table_of_rows ~header:["Name"; "Score"]
 [[Some "John"; Some "99"]; [Some "Paul"; Some "68"]]
 (Text Border.Unicode)
 |> Result.get_ok
 |> print_endline
┌───────┬───────┐
│ Name │ Score │
├───────┼───────┤
│ John │ 99 │
│ Paul │ 68 │
└───────┴───────┘

The CLI reads CSV from stdin or files:

printf 'Name,Score\nJohn,99\nPaul,68\n' | tbls --border unicode

See man tbls for all options and exit codes.

License

ISC. See LICENSE.