All Projects → jedib0t → Go Pretty

jedib0t / Go Pretty

Licence: mit
Pretty print tables and more in golang!

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Pretty

Simpletable
Simple tables in terminal with Go
Stars: ✭ 288 (-62.93%)
Mutual labels:  ascii, table
Tabulator
Interactive Tables and Data Grids for JavaScript
Stars: ✭ 4,329 (+457.14%)
Mutual labels:  list, table
Rsup Progress
❤️ A simple progress bar with promises support
Stars: ✭ 290 (-62.68%)
Mutual labels:  progress-bar, progressbar
svelte-progressbar
A multiseries, SVG progressbar component made with Svelte
Stars: ✭ 85 (-89.06%)
Mutual labels:  progress-bar, progressbar
Multiprogressview
📊 An animatable view that depicts multiple progresses over time. Modeled after UIProgressView
Stars: ✭ 614 (-20.98%)
Mutual labels:  progress-bar, progressbar
Libfort
C/C++ library to create formatted ASCII tables for console applications
Stars: ✭ 255 (-67.18%)
Mutual labels:  ascii, table
Pb
Console progress bar for Rust
Stars: ✭ 402 (-48.26%)
Mutual labels:  progress-bar, progressbar
react-tabllist
React-based customizable style table or list components that support event and callback functions.
Stars: ✭ 20 (-97.43%)
Mutual labels:  list, table
Node.cli Progress
⌛️ easy to use progress-bar for command-line/terminal applications
Stars: ✭ 466 (-40.03%)
Mutual labels:  progress-bar, progressbar
Ascii Tables
Quickly format table in ASCII. Great for code comments, or Github Markdown!
Stars: ✭ 416 (-46.46%)
Mutual labels:  ascii, table
VHProgressBar
Vartical and Horizontal ProgressBar
Stars: ✭ 23 (-97.04%)
Mutual labels:  progress-bar, progressbar
Terminaltables
Generate simple tables in terminals from a nested list of strings.
Stars: ✭ 685 (-11.84%)
Mutual labels:  ascii, table
ffmpeg-progressbar-cli
A colored progress bar for FFmpeg.
Stars: ✭ 140 (-81.98%)
Mutual labels:  progress-bar, progressbar
Progress bar
Command-line progress bars and spinners for Elixir.
Stars: ✭ 281 (-63.84%)
Mutual labels:  progress-bar, progressbar
ctable
C library to print nicely formatted tables
Stars: ✭ 13 (-98.33%)
Mutual labels:  ascii, table
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+2555.34%)
Mutual labels:  progress-bar, progressbar
LineProgressbar
A light weight jquery progressbar plugin
Stars: ✭ 34 (-95.62%)
Mutual labels:  progress-bar, progressbar
suru
A tqdm-style progress bar in Nim
Stars: ✭ 40 (-94.85%)
Mutual labels:  progress-bar, progressbar
Portable Utf8
🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.
Stars: ✭ 405 (-47.88%)
Mutual labels:  ascii, string-manipulation
Ep
enhance your HTML5 progress bars with minimal effort!
Stars: ✭ 648 (-16.6%)
Mutual labels:  progress-bar, progressbar

go-pretty

Go Reference Build Status Coverage Status Go Report Card

Utilities to prettify console output of tables, lists, progress-bars, text, etc.

Table

Pretty-print tables into ASCII/Unicode strings.

+-----+------------+-----------+--------+-----------------------------+
|   # | FIRST NAME | LAST NAME | SALARY |                             |
+-----+------------+-----------+--------+-----------------------------+
|   1 | Arya       | Stark     |   3000 |                             |
|  20 | Jon        | Snow      |   2000 | You know nothing, Jon Snow! |
| 300 | Tyrion     | Lannister |   5000 |                             |
+-----+------------+-----------+--------+-----------------------------+
|     |            | TOTAL     |  10000 |                             |
+-----+------------+-----------+--------+-----------------------------+

More details can be found here: table/

List

Pretty-print lists with multiple levels/indents into ASCII/Unicode strings.

 ■ Game Of Thrones
   ■ Winter
   ■ Is
   ■ Coming
     ■ This
     ■ Is
     ■ Known
 ■ The Dark Tower
   ■ The Gunslinger

More details can be found here: list/

Progress

Track the Progress of one or more Tasks (like downloading multiple files in parallel).

Sample Progress Tracking:

Calculating Total   #  1 ... done! [3.25K in 100ms]
Calculating Total   #  2 ... done! [6.50K in 100ms]
Downloading File    #  3 ... done! [9.75KB in 100ms]
Transferring Amount #  4 ... done! [$26.00K in 200ms]
Transferring Amount #  5 ... done! [£32.50K in 201ms]
Downloading File    #  6 ... done! [58.50KB in 300ms]
Calculating Total   #  7 ... done! [91.00K in 400ms]
Transferring Amount #  8 ... 60.9% (●●●●●●●●●●●●●●◌◌◌◌◌◌◌◌◌) [$78.00K in 399.071ms]
Downloading File    #  9 ... 32.1% (●●●●●●●○◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌) [58.50KB in 298.947ms]
Transferring Amount # 10 ... 13.0% (●●○◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌◌) [£32.50K in 198.84ms]

More details can be found here: progress/

Text

Utility functions to manipulate text with or without ANSI escape sequences. Most of the functions available are used in one or more of the other packages here.

The unit-tests for each of the above show how these can be used. There GoDoc should also have examples for all the available functions.

Benchmarks

Partial output of make bench on CI:

BenchmarkList_Render-2            	  372352	      3179 ns/op	     856 B/op	      38 allocs/op
BenchmarkProgress_Render-2        	       4	 300318682 ns/op	    3438 B/op	      87 allocs/op
BenchmarkTable_Render-2           	   27208	     44154 ns/op	    5616 B/op	     179 allocs/op
BenchmarkTable_RenderCSV-2        	  108732	     11059 ns/op	    2624 B/op	      46 allocs/op
BenchmarkTable_RenderHTML-2       	   88633	     13425 ns/op	    4080 B/op	      45 allocs/op
BenchmarkTable_RenderMarkdown-2   	  107420	     10991 ns/op	    2560 B/op	      44 allocs/op

A note about v6.0.0 and above ...

To make go-pretty completely compatible with go mod, versions v6.0.0 and above will include changes that are known to break dep support. As far as I can tell, dep is looking for funding right now and is not being actively developed or maintained and has an interoperability issue with how go mod deals with package versioning.

If you want to continue to use dep, versions v5.1.x and below should continue to work. If dep maintainers can merge the code proposed in PR#1963, it should make v6.0.0 and above usable too. Given that the PR has not been merged since July 2018, I am not too hopeful. 😞

To use v6.0.0 (or newer version) of this library, you'd have to modify the import paths from something like:

    "github.com/jedib0t/go-pretty/list"
    "github.com/jedib0t/go-pretty/progress"
    "github.com/jedib0t/go-pretty/table"
    "github.com/jedib0t/go-pretty/text"

to:

    "github.com/jedib0t/go-pretty/v6/list"
    "github.com/jedib0t/go-pretty/v6/progress"
    "github.com/jedib0t/go-pretty/v6/table"
    "github.com/jedib0t/go-pretty/v6/text"

I'd recommend you fire up your favorite IDE and do a mass search and replace for all occurrences of jedib0t/go-pretty/ to jedib0t/go-pretty/v6/. If you are on a system with access to find, grep, xargs and sed, you could just run the following from within your code folder to do the same:

find . -type f -name "*.go" | grep -v vendor | xargs sed -i 's/jedib0t\/go-pretty\//jedib0t\/go-pretty\/v6\//'g
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].