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

Overview

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

v6.0.0++

If you are using a version of this library older than v6.0.0 and want to move to a 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
Issues
  • Set background/foreground colors by row

    Set background/foreground colors by row

    Hi,

    Really nice package, easy to use and direct csv/html outputs are great.

    I would like to change color row, didn't see anything related. My purpose is to set a background in red if a specific = X, green if Y, etc.

    Same idea with html export, It could specify class for rows.

    Regards,

    enhancement 
    opened by Issif 24
  • add mutex to progress for prevent race condition

    add mutex to progress for prevent race condition

    it might not the best way to fix the race condition, but it fixed the overwritten in race condition and stable in thread safe state when many goroutine called progress render.

    opened by Haraguroicha 16
  • Horizontally merged rows always centered

    Horizontally merged rows always centered

    At this point this isn't a bug report or feature request, but a question. I was attempting to create a summary footer row I wanted merged and aligned to the right, but it was always centered. Digging into it some more, it looks like this is the desired effect - https://github.com/jedib0t/go-pretty/blob/main/table/render.go#L86. Could you add some context as to why you override the alignment to always be centered (instead of maybe a default if unset)?

    enhancement 
    opened by jlambert121 14
  • Sort by time.Date

    Sort by time.Date

    Firstly, thank you for this thoughtfully implemented project! The documentation (via comments and code) are very well done and the use of library is very intuitive!

    Is your feature request related to a problem? Please describe. As the title hints, sorting by the builtin time.Time struct would be a logical additional feature to this project. I have a personal project used to translate and reconcile a my bank account against my budget app (don't ask me why they don't already). So naturally, I want the table to be printed chronologically.

    My current solution is to print an additional column for the unix (int) representation of the time and sort the table by that column. This works fine but for a table hundreds or thousands of rows long, it's a pretty ugly output. I'm functionally printing 2 time.Time columns, in different formats.

    Describe the solution you'd like An option to sort tables by time.Time values.

    Describe alternatives you've considered Defining an additional column to list unix time, then sorting that by integer values. It's ugly and requires extra, likely duplicated code. Pretty much anyone who wants to sort by date will need two columns - one for human readable time, and one for sortable time.

    Additional context Add any other context or screenshots about the feature request here.

    My project is still incomplete, but if you're interested to see how i'm consuming this project: https://github.com/copejon/reconcilitator

    Excuse the multitude of readme typos. Written late at night and not as fun to fix as coding.

    enhancement disc 
    opened by copejon 12
  • Respect separators with auto-merge

    Respect separators with auto-merge

    I am trying to build a table which shows who you are playing and also prints the board. The best I have been able to achive is the following:

    ┏━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
    ┃   ┃ MY TURN ┃ OPPONENT     ┃ LAST MOVE ┃ BOARD           ┃
    ┣━━━╋━━━━━━━━━╋━━━━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫
    ┃ 0 ┃ true    ┃ A.I. level 1 ┃ c2c3      ┃ ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖ ┃
    ┃   ┃         ┃              ┃           ┃ ♙ ♙ ♙ - ♙ ♙ ♙ ♙ ┃
    ┃   ┃         ┃              ┃           ┃ - - - - - - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - ♙ - - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - - - - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - ♟ ♟ - - - - ┃
    ┃   ┃         ┃              ┃           ┃ ♟ ♟ - - ♟ ♟ ♟ ♟ ┃
    ┃   ┃         ┃              ┃           ┃ ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜ ┃
    ┣━━━╋         ┃              ┣━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫
    ┃ 1 ┃         ┃              ┃ g8f6      ┃ ♜ ♞ ♝ ♚ ♛ ♝ - ♜ ┃
    ┃   ┃         ┃              ┃           ┃ ♟ ♟ ♟ ♟ - ♟ ♟ ♟ ┃
    ┃   ┃         ┃              ┃           ┃ - - - - - ♞ - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - - ♟ - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - - ♙ - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - ♘ - - - - - ┃
    ┃   ┃         ┃              ┃           ┃ ♙ ♙ ♙ ♙ - ♙ ♙ ♙ ┃
    ┃   ┃         ┃              ┃           ┃ ♖ - ♗ ♔ ♕ ♗ ♘ ♖ ┃
    ┗━━━┻━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛
    

    However I think it would look neater with each row. Especially with more games.

    ┏━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
    ┃   ┃ MY TURN ┃ OPPONENT     ┃ LAST MOVE ┃ BOARD           ┃
    ┣━━━╋━━━━━━━━━╋━━━━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫
    ┃ 0 ┃ true    ┃ A.I. level 1 ┃ c2c3      ┃ ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖ ┃
    ┃   ┃         ┃              ┃           ┃ ♙ ♙ ♙ - ♙ ♙ ♙ ♙ ┃
    ┃   ┃         ┃              ┃           ┃ - - - - - - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - ♙ - - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - - - - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - ♟ ♟ - - - - ┃
    ┃   ┃         ┃              ┃           ┃ ♟ ♟ - - ♟ ♟ ♟ ♟ ┃
    ┃   ┃         ┃              ┃           ┃ ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜ ┃
    ┣━━━╋━━━━━━━━━╋━━━━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫
    ┃ 1 ┃ true    ┃ A.I. level 1 ┃ g8f6      ┃ ♜ ♞ ♝ ♚ ♛ ♝ - ♜ ┃
    ┃   ┃         ┃              ┃           ┃ ♟ ♟ ♟ ♟ - ♟ ♟ ♟ ┃
    ┃   ┃         ┃              ┃           ┃ - - - - - ♞ - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - - ♟ - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - - - ♙ - - - ┃
    ┃   ┃         ┃              ┃           ┃ - - ♘ - - - - - ┃
    ┃   ┃         ┃              ┃           ┃ ♙ ♙ ♙ ♙ - ♙ ♙ ♙ ┃
    ┃   ┃         ┃              ┃           ┃ ♖ - ♗ ♔ ♕ ♗ ♘ ♖ ┃
    ┗━━━┻━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛
    

    For now I will stick with where it is at the moment, but I think it will start to look untidy if it's constantly flipping between merged and unmerged.

    Seems to me like t.AppendSeparator should break the merge, or at least this should be an option.

    Thanks

    disc 
    opened by mattcanty 11
  • Indeterminate Progress bar

    Indeterminate Progress bar

    Is your feature request related to a problem? Please describe.

    I have a tool which performs several operations where the total is unknown. I still use a progress bar to indicate that something is happening, but it would be nice to have a mode where the progressbar indicate that its length is unknown.

    Describe the solution you'd like

    Similar to how pv works with a unknown length, it will just show the speed and have a little widget flying back'n'forth in the progress area

     [....<=>............] [34 in 3.504094s] ... Fetching ...
    

    Describe alternatives you've considered The current progressbar works, but it gives the user a sense that no progress is happening since it will always show 0%

    Additional context For reference, my needs come from having 10 parallel workers that each work on the same list of input. I have a master tracker for the total number of completed work, but I also have one for each worker - this way I can have a progressbar with a message for each piece of work currently being worked on:

    99.71% [#################.] [680 in 3.50413s] ... Total
     0.00% [..................] [34 in 3.504094s] ... Fetching aaa
     0.00% [..................] [34 in 3.504095s] ... Fetching bbb
     0.00% [..................] [34 in 3.504068s] ... Fetching ccc
     0.00% [..................] [34 in 3.50407s] ... Fetching ddd
    

    Since all workers share the same pool of work, they can't know how many they will work on in total

    enhancement 
    opened by ptxmac 9
  • Strange padding issue when rendering `%` in a column

    Strange padding issue when rendering `%` in a column

    Describe the bug Hello, I'm working on a PR in another project which is using this library: https://github.com/rocketmiles/aws-cct/pull/9

    I'm attempting to add a column which is a percent value, so I'm also adding % as part of the fmt.Sprintf call: https://github.com/rocketmiles/aws-cct/pull/9/files#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261R175

    The first issue I came across is that I seemed to need to "double escape" the percentage sign (%%%% instead of %% as I expected based on Go docs). The second is that the padding on the column seems to think that there are 2 characters added instead of one (note the border is collapsed by 1 char):

    +-------------------------------------------------+-------------+-------------+------------+---------------+
    | SERVICE                                         | 2020-09-01  | 2020-10-01  | DELTA      | DELTA PERCENT |
    +-------------------------------------------------+-------------+-------------+------------+---------------+
    | Amazon Macie                                    |       $0.00 |      $56.40 |     $56.40 |       +Inf%  |
    | Amazon Comprehend                               |       $0.00 |       $0.02 |      $0.02 |       +Inf%  |
    | Amazon EC2 Container Service                    |      $64.22 |     $151.43 |     $87.21 |      135.8%  |
    

    To Reproduce

    • Check out code from PR: https://github.com/rocketmiles/aws-cct/pull/9/files#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261R175
    • Run go build && ./aws-cct (requires valid AWS creds in your config)

    If there's nothing immediately obvious about this bug report or if you think it might be some other part of my system I can try to make a more specific reproduction.

    Expected behavior

    • Escape % normally: %% instead of %%%%
    • Table padding is calculated correctly

    Screenshots

    Software (please complete the following information):

    • OS: MacOS 10.15.7
    • go1.15.3 darwin/amd64

    Additional context None

    opened by mwarkentin 9
  • Progressbar ETA when ShowOverallTracker(false)

    Progressbar ETA when ShowOverallTracker(false)

    Is your feature request related to a problem? Please describe.

    ETA is not displayed when using pw.ShowOverallTracker(false)

    Describe the solution you'd like

    Add a ShowETA function to display the ETA when not using OverallTracker

    Thanks!

    Nicolas.

    enhancement 
    opened by nicocha30 9
  • Table Title

    Table Title

    Hi,

    Is there a way to write a title like this and all table be aligned?

    +Title-+-----+--------+-----------+------+-----------------------------+
    |      |  A  |    B   |     C     |   D  |              E              |
    +------+-----+--------+-----------+------+-----------------------------+
    | 1   |   1 | Arya   | Stark     | 3000 |                             |
    | 2   |  20 | Jon    | Snow      | 2000 | You know nothing, Jon Snow! |
    | 3   | 300 | Tyrion | Lannister | 5000 |                             |
    +------+-----+--------+-----------+------+-----------------------------+
    

    I have tried creating a new BoxStyle changing TopLeft but the first line gets bigger and the others not.

    enhancement disc 
    opened by amandahla 8
  • progress: add incremental failure mode

    progress: add incremental failure mode

    Thought about it, looks like changing the message is likely to be difficult, so I'm just going to highlight it instead. Changes SetValue behavior but I think that's fine since it's a relatively new change?

    Fixes #159

    opened by virtuald 7
  • text: Remove dependency on github.com/go-openapi/strfmt

    text: Remove dependency on github.com/go-openapi/strfmt

    This is a non-breaking change that removes the dependency on github.com/go-openapi/strfmt. Formatting a strfmt.DateTime still works, though the format is different.

    This removes a large set of indirect dependencies, including a MongoDB driver.

    opened by titanous 7
  • Transformer affects sorting

    Transformer affects sorting

    Describe the bug I expected SortBy to operate on the raw table data. However as soon as I set a transformer on the column I sort by, the sorting breaks.

    Software (please complete the following information):

    • OS: Linux
    • GoLang Version 1.15.2
    enhancement 
    opened by muesli 3
  • Support cell merging on a per cell basis with something like HTML's

    Support cell merging on a per cell basis with something like HTML's "colspan"

    Is your feature request related to a problem? Please describe.

    I'd like to display tables with more control over the exact placement of separators than auto-merge allows. For example, something like this:

    ┌───────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Failed test: 1 == 0                                                                           │
    ├──────┬─────────────────┬────┬─────────────────┬───────────────────────────────────────────────┤
    │      │      ACTUAL     │    │      EXPECT     │                                               │
    │ PATH │ TYPE   │ VALUE  │ OP │ TYPE   │ VALUE  │ CALLER                                        │
    ├──────┼────────┴────────┴────┴────────┴────────┼───────────────────────────────────────────────┤
    │ int  │                 │    │                 │ demo/[email protected] called detest.(*D).Equal │
    │      │ int    │ 1      │ == │ int    │ 0      │                                               │
    └──────┴────────┴────────┴────┴────────┴────────┴───────────────────────────────────────────────┘
    

    Note the extra separators on the line starting with the caller "demo/demo_test.go ...".

    AFAICT, there's no way to do this with auto-merge.

    Describe the solution you'd like

    I think the best way to do this would be to allow more explicit control over cell merging, with something like HTML's colspan. To do this in the current API I think you'd need to add something to the existing RowConfig{} struct. But a much nicer API would probably require creating some sort of Cell{} struct that could have a colspan (and it would also allow for much more granular control of horizontal alignment as a bonus).

    Describe alternatives you've considered

    I'm not sure there is any alternative to this, other than just accepting that I cannot do this. FWIW, I started off implementing my own table package which does do this, but it doesn't do cell wrapping, so I was looking at alternatives. If you're curious you can see my WIP at https://github.com/houseabsolute/detest/tree/master/internal/table

    (As an aside, I'm now realizing that go-pretty doesn't do cell wrapping either, just truncation, so I'll probably keep working on my package, but I'd love to offload this work to something that other people are already using!)

    enhancement 
    opened by autarch 6
  • Option to invert rows and columns

    Option to invert rows and columns

    Is it possible to add a feature to flip a table, such that the rows and columns are interchanged? For example, table

    -----------------------
    | Header 1 | Header 2 |
    -----------------------
    | Data 1   | Data 2   |
    -----------------------
    | Data 3   | Data 4   |
    -----------------------
    

    should be flipped to

    ------------------------------
    | Header 1 | Data 1 | Data 3 |
    ------------------------------
    | Header 2 | Data 2 | Data 4 |
    ------------------------------
    
    enhancement 
    opened by infinitepr0 4
Releases(v6.3.3)
  • v6.3.3(Jun 20, 2022)

    Bug-Fixes

    • text
      • deprecate text.RuneCount for being misnamed (#209)
      • introduce text.RuneWidthWithoutEscSequences as a replacement
    • dependencies
      • upgrade testify from v1.7.0 to v1.7.4 to avoid using yaml.v3 v3.0.0 (#210)
    Source code(tar.gz)
    Source code(zip)
  • v6.3.2(Jun 7, 2022)

  • v6.3.1(Apr 14, 2022)

    Features

    • progress
      • Deprecate all the Show* interfaces in progress.Progress and progress.Writer (to be removed in v7)
      • Introduce progress.Style.Visibility with same defaults as before
      • Introduce progress.Style.Visibility.ETAOverall as a new option for addressing bug #196
    Source code(tar.gz)
    Source code(zip)
  • v6.3.0(Mar 23, 2022)

  • v6.2.7(Feb 7, 2022)

  • v6.2.6(Feb 7, 2022)

  • v6.2.5(Jan 21, 2022)

    Bug-Fixes

    • progress
      • support control of notation position (#180)
    • table
      • fix rendering issues with nil values (#179)

    Misc

    • Sonar integration and fixes for some issues/smells
    • Update dependencies and go to 1.16
    • Fix some minor readability and quality issues

    Thanks @ferryvg for the bug-fixes!

    Source code(tar.gz)
    Source code(zip)
  • v6.2.4(Jul 11, 2021)

    Bug-Fixes

    • progress
      • render once before terminating to ensure one minimum render (#173)
      • improve rendering and prevent races (#174, #175)
    • table
      • fix documentation and remove bad samples (#176)

    Thanks @virtuald and @kamikazechaser!

    Source code(tar.gz)
    Source code(zip)
  • v6.2.3(Jul 7, 2021)

  • v6.2.2(May 22, 2021)

  • v6.2.1(Apr 23, 2021)

  • v6.2.0(Apr 22, 2021)

    Bug-Fixes

    • progress (lot of fixes from @virtuald again -- thanks!)
      • don't use mutex twice in ETA function (#158)
      • add incremental failure mode (#160)
      • Tracker.UpdateMessage() to safely update the tracker Message mid-way (#162)

    Misc

    • default branch is now main instead of master
    Source code(tar.gz)
    Source code(zip)
  • v6.1.1(Apr 7, 2021)

    Bug-Fixes

    • progress (lot of fixes from @virtuald)
      • simplify indeterminate indicator code (#148)
      • don't leak time.Tick channel (#152)
      • way to tell that a tracker/operation failed (#153)
      • fix incorrect mutex usages (#154)

    Misc

    • documentation fixes
    Source code(tar.gz)
    Source code(zip)
  • v6.1.0(Jan 30, 2021)

    Features

    • progress
      • Style.Chars.Indeterminate: mechanism to show progress where the end is unknown
      • Quite a few built-in styles for this, including a semi-decent Pac-Man version ;)

    Bug-Fixes

    • progress
      • plug possible race conditions due to bad mutex usage
    Source code(tar.gz)
    Source code(zip)
  • v6.0.6(Jan 20, 2021)

  • v6.0.5(Oct 1, 2020)

    Bug-Fixes

    • table
      • Title row length should match rest of the table when shorter (thanks @FoamCactus)
      • Adjust auto-index column IDs for for https://github.com/golang/go/issues/32479 (thanks @eclipseo)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.4(Jun 11, 2020)

  • v6.0.3(May 27, 2020)

  • v6.0.2(May 17, 2020)

    Features

    • table
      • provide options in Style.HTML to control HTML rendering:
        • CSSClass to set the CSS class-name for the table (default: go-pretty-table)
        • EmptyColumn to control what to print for an empty column (default: &nbsp;)
        • EscapeText to control whether to invoke html.Escape on all columns (default: true)
        • Newline: to control whether \n should be replaced, and with what (default: <br/>)

    Deprecations

    table

    | Old Functionality | Replacement | | --- | --- | | SetHTMLCSSClass | Style().HTML.CSSClass |

    Source code(tar.gz)
    Source code(zip)
  • v6.0.1(May 16, 2020)

  • v6.0.0(May 15, 2020)

  • v5.1.0(May 15, 2020)

    Features

    • table
      • support auto-merge of cells in a row with RowConfig.AutoMerge (2nd part of fix for #93)

    Bug-Fixes

    • table
      • text.Format* can now deal with escape sequences; (fix for #112)

    Note

    This will be the last dep compatible release thanks to go mod enforcing major versions above v1 to be part of the import path.

    Source code(tar.gz)
    Source code(zip)
  • v5.0.1(May 10, 2020)

    Features

    • table
      • support auto-merge of cells in a column with ColumnConfig.AutoMerge
      • support title/caption using the <caption> tag on the table in HTML mode

    Bug-Fixes

    • table
      • support auto-index in CSV/HTML/Markdown modes

    General

    • update dependency go-runewidth to v0.0.9 to enhance emoji support
    Source code(tar.gz)
    Source code(zip)
  • v5.0.0(May 8, 2020)

    Features

    • table
      • AppendSeparator to append a separator after the last appended row
      • ColumnConfig.Hidden flag to control the visibility of individual columns
      • ColumnConfig.WidthMaxEnforcer to customize how WidthMax is applied/enforced
      • ResetFooters to reset and remove all appended footers
      • ResetHeaders to reset and remove all appended headers
      • ResetRows to reset and remove all appended rows
      • Deprecated interfaces have been removed; refer to the table below for details
    • General
      • Transition from dep to go mod for dependency management

    Deprecations

    table

    | Old Functionality | Replacement | | --- | --- | | SetAlign | SetColumnConfig with ColumnConfig.Align | | SetAlignFooter | SetColumnConfig with ColumnConfig.AlignFooter | | SetAlignHeader | SetColumnConfig with ColumnConfig.AlignHeader | | SetAllowedColumnLengths | SetColumnConfig with ColumnConfig.WidthMax | | SetColors | SetColumnConfig with ColumnConfig.Colors | | SetColorsFooter | SetColumnConfig with ColumnConfig.ColorsFooter | | SetColorsHeader | SetColumnConfig with ColumnConfig.ColorsHeader | | SetVAlign | SetColumnConfig with ColumnConfig.VAlign | | SetVAlignFooter | SetColumnConfig with ColumnConfig.VAlignFooter | | SetVAlignHeader | SetColumnConfig with ColumnConfig.VAlignHeader |

    Source code(tar.gz)
    Source code(zip)
  • v4.3.0(Jul 29, 2019)

  • v4.2.1(Jun 10, 2019)

  • v4.2.0(May 30, 2019)

    This minor release contains a bunch of content:

    ProgressWriter

    @Haraguroicha found a plethora of go-routine-unsafe variable accesses in Progress Writer. This release contains the fixes for the same and prevents all identified unsafe accesses and sets up tests to check for race-conditions in the build process.

    Thanks @Haraguroicha!

    TableWriter

    @Issif requested functionality to control the colorization of individual rows based on the content of the row and also for the capability to output the color coding in RenderHTML() output. This release contains these features and some more:

    • introduce a new interface SetColumnConfigs() to control every option for a column:
      • Alignment (horizontal, vertical)
      • Colors
      • Transformation
      • Width (minimum, maximum)
    • mark older interfaces for deprecation:
      • SetAlign(), SetAlignFooter(), SetAlignHeader()
      • SetAllowedColumnLengths()
      • SetColors(), SetColorsFooter(), SetColorsHeader()
      • SetVAlign(), SetVAlignFooter(), SetVAlignHeader()
    • support RowPainter to determine the colors to be used on an entire row overriding ColumnConfig settings
    • support text.Colors in HTML using similarly named CSS classes that can be customized by end-user

    Thanks @Issif for the feedback!

    Source code(tar.gz)
    Source code(zip)
  • v4.1.0(May 8, 2019)

    The text package has a couple of new functions:

    • Escape to wrap a string with a given ANSI escape sequence
    • StripEscape to strip away all ANSI escape sequences in a string
    Source code(tar.gz)
    Source code(zip)
  • v4.0.3(Apr 29, 2019)

    This patch release does a better job at calculating character widths for Unicode characters as they appear on the console and render tables with such characters with a higher precision. It is not going to be 100% right all the time as the typeface plays a huge role in how the character gets rendered, but it will be better than before.

    New Dependency: github.com/mattn/go-runewidth

    Source code(tar.gz)
    Source code(zip)
  • v4.0.2(Dec 10, 2018)

Owner
Naveen Mahalingam
Naveen Mahalingam
OTF font with vertical bars for one-line ASCII spectrum analyzers, graphs, etc

graph-bars-font OTF font with vertical bars for one-line ASCII spectrum analyzers, graphs, etc. I didn't find anything similar on the net so I decided

Andrew Dunai 16 Apr 16, 2022
Console progress bar for Golang

Terminal progress bar for Go Installation go get github.com/cheggaaa/pb/v3 Documentation for v1 bar available here Quick start package main import (

Sergey Cherepanov 3.2k Jun 30, 2022
Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors.

Chalk Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors. Documentati

null 5 Jun 26, 2022
null 0 Jan 27, 2022
Go simple progress bar writing to output

?? progress-go Go simple progress bar writing to output ?? ABOUT Contributors: Rafał Lorenz Want to contribute ? Feel free to send pull requests! Have

Rafał Lorenz 53 Jun 11, 2022
A tiny markup language for terminal output. Makes formatting output in CLI apps easier!

tml - Terminal Markup Language A Go module (and standalone binary) to make the output of coloured/formatted text in the terminal easier and more reada

Liam Galvin 680 Jun 27, 2022
Fast, realtime regex-extraction, and aggregation into common formats such as histograms, numerical summaries, tables, and more!

rare A file scanner/regex extractor and realtime summarizor. Supports various CLI-based graphing and metric formats (histogram, table, etc). Features

Chris LaPointe 155 Jun 30, 2022
A CLI tool which loads data from yaml files into the Google Cloud Spanner tables

splanter A CLI tool which loads data from yaml files into the Google Cloud Spanner tables (mainly for the development).

Yuki Ito 6 Jun 20, 2022
Project-2 - Create a project that calls service created above, pass text and prints JSON output returned from the service

Project Assignment Steps to run the project: First Download the repo present her

null 0 Jan 27, 2022
tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

sago35 0 Feb 6, 2022
progress_bar creates a single customizable progress bar for Linux terminal.

progress_bar Go Progress Bar Features progress_bar creates a single customizable progress bar for Linux terminal. Installation go get -u github.com/er

erman imer 126 Jan 14, 2022
A really basic thread-safe progress bar for Golang applications

progressbar A very simple thread-safe progress bar which should work on every OS without problems. I needed a progressbar for croc and everything I tr

Zack 2.5k Jun 23, 2022
multi progress bar for Go cli applications

Multi Progress Bar mpb is a Go lib for rendering progress bars in terminal applications. Features Multiple Bars: Multiple progress bars are supported

Vladimir Bauer 1.7k Jun 23, 2022
Go (golang) package with 70+ configurable terminal spinner/progress indicators.

Spinner spinner is a simple package to add a spinner / progress indicator to any terminal application. Examples can be found below as well as full exa

Brian Downs 1.8k Jun 23, 2022
Print day progress in your terminal

Day progress Print day progress in your terminal Install go install github.com/tsivinsky/[email protected] Usage day-progress By default, day-progre

Daniil Tsivinsky 0 Jan 10, 2022
Golang-video-screensaver - A work in progress Microsoft Windows video screensaver implemented in Go

golang-video-screensaver A work in progress Microsoft Windows video screensaver

null 0 Mar 2, 2022
Console-based JVM monitoring tool

jvm-mon Console based JVM monitoring - when you just want to SSH into a server and see what's going on. jvm-top lets you monitor your JVM server appli

Andrejs Jermakovics 1.4k Jun 8, 2022
Disk usage analyzer with console interface written in Go

Gdu is intended primarily for SSD disks where it can fully utilize parallel processing. However HDDs work as well, but the performance gain is not so huge.

Daniel Milde 1.8k Jun 22, 2022
Integrated console application library, using Go structs as commands, with menus, completions, hints, history, Vim mode, $EDITOR usage, and more ...

Gonsole - Integrated Console Application library This package rests on a readline console library, (giving advanced completion, hint, input and histor

null 17 Apr 3, 2022