• Stars
    star
    721
  • Rank 60,353 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A go library to improve readability in terminal apps using tabular data

uitable GoDoc Build Status

uitable is a go library for representing data as tables for terminal applications. It provides primitives for sizing and wrapping columns to improve readability.

Example Usage

Full source code for the example is available at example/main.go

table := uitable.New()
table.MaxColWidth = 50

table.AddRow("NAME", "BIRTHDAY", "BIO")
for _, hacker := range hackers {
  table.AddRow(hacker.Name, hacker.Birthday, hacker.Bio)
}
fmt.Println(table)

Will render the data as:

NAME          BIRTHDAY          BIO
Ada Lovelace  December 10, 1815 Ada was a British mathematician and writer, chi...
Alan Turing   June 23, 1912     Alan was a British pioneering computer scientis...

For wrapping in two columns:

table = uitable.New()
table.MaxColWidth = 80
table.Wrap = true // wrap columns

for _, hacker := range hackers {
  table.AddRow("Name:", hacker.Name)
  table.AddRow("Birthday:", hacker.Birthday)
  table.AddRow("Bio:", hacker.Bio)
  table.AddRow("") // blank
}
fmt.Println(table)

Will render the data as:

Name:     Ada Lovelace
Birthday: December 10, 1815
Bio:      Ada was a British mathematician and writer, chiefly known for her work on
          Charles Babbage's early mechanical general-purpose computer, the Analytical
          Engine

Name:     Alan Turing
Birthday: June 23, 1912
Bio:      Alan was a British pioneering computer scientist, mathematician, logician,
          cryptanalyst and theoretical biologist

Installation

$ go get -v github.com/gosuri/uitable

More Repositories

1

uiprogress

A go library to render progress bars in terminal applications
Go
2,062
star
2

uilive

uilive is a go library for updating terminal output in realtime
Go
1,648
star
3

vagrant-env

Vagrant plugin to load environment variables from .env into ENV
Ruby
144
star
4

go-store

A simple and fast Redis backed key-value store library for Go
Go
112
star
5

cmdns

cmdns is a go library for namespacing a command tree
Go
25
star
6

aws-rds-cookbook

Development repository for chef cookbook aws-rds
Ruby
16
star
7

dotfiles

Greg Osuri's dotfiles
Shell
10
star
8

terraform-exec-provider

Go
9
star
9

git-url-sub

git remote url substitution utility
Shell
7
star
10

awesome-sysops

Curated list of awesome tools for systems operators
6
star
11

rails-app-cookbook

Example cookbook using aws-rds cookbook to install rails_app
Ruby
6
star
12

dsky

dsky is a UI framework for terminal applications
Go
5
star
13

monocle

a go library for advanced command line help
Go
5
star
14

multibar

[DEPRICATED] MultiBar is go library to render progress bars in the terminal
Go
5
star
15

Pylearn

Greg Osuri's Python Journey
4
star
16

uiutil

uiutil is a go library that provides a set of helpers to improve readbility in terminal applications
Go
4
star
17

handshake-containers

Makefile
4
star
18

ctxexec

ctxexec is go library that provides helper functions for running context-aware external commands
Go
3
star
19

grumpy

Grumpy cat is a blockchain to honor Grumpy Cat
TypeScript
2
star
20

gosuri.github.io

Source for gregosuri.com
SCSS
2
star
21

aws-vpc-terraform-post

Support files for my airpair post
1
star
22

petit

a simple, fast, rack-based url routing server
Ruby
1
star
23

test-runner

Linux container based test running tools for ruby applications
Shell
1
star
24

ap-workshop-cookbooks

Chef cookbooks for my Airpair containers workshop
Ruby
1
star
25

vanitypkg

vanitypkg provides a server that hosts vanity package names for Go package hosted on github
Go
1
star
26

akt20

1
star
27

hostnamer

Cluster member discovery and registration tool for Route 53
Ruby
1
star
28

knife-ec2-ssh-config

Knife plugin to update ssh client config with ec2 instance information
Ruby
1
star
29

chef-ebs-directory

Chef cookbook for moving a directory to a ebs volume
Ruby
1
star
30

noop

An empty repo used for testing git ops
1
star
31

build-compiler

Container based build tools for Ubuntu 14.04
Shell
1
star
32

nextjs-notes

JavaScript
1
star
33

eve

eve fork
Go
1
star