uniseg
go-pretty
uniseg | go-pretty | |
---|---|---|
6 | 2 | |
552 | 2,642 | |
- | - | |
6.5 | 7.1 | |
about 1 month ago | 17 days ago | |
Go | Go | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
uniseg
- Should unicode/utf8 have funcs for graphemes?
-
UTF-8 strings with Go: len(s) isn't enough
So far, I've found this package for Unicode text segmentation: https://github.com/rivo/uniseg
-
Why do we get byte and rube when iterating a string using for loop or for range respectivly?
Ah this is an intreresting one. Iโve recently had to deal with graphemes and after learning a bit more about them with a coworker, was surprised to find there doesnโt seem to be native support for them in Golang. Does anyone know if support for dealing with graphemes will be added eventually? For the moment Iโve used https://github.com/rivo/uniseg
-
FYI: a single Go rune is not the same as a single visible character
Yes, what you want is called a grapheme cluster. It faithfully represents one "visible" character in your terminal. Use something like https://github.com/rivo/uniseg to turn a string into graphemes and iterate over them.
-
Strings in Go
There is an open source library github.com/rivo/uniseg that provides a function to do just this. It provides a function GraphemeClusterCount that returns the number of characters that is present in this string. Check out the source code on Github for details about the author and the implementation.
go-pretty
-
Building Rich CLI Applications with Go's Built-in Templating
If anyone would be confused, the tables part is also from https://github.com/jedib0t/go-pretty
-
Box CLI Maker ๐ฆ: Make Highly Customized Boxes for your CLI
Interesting: I might have a use case for a recreational project I am writing right now. At the moment I use go-pretty but I may switch to this one since I do really need just a box.
What are some alternatives?
go - The Go programming language
pterm - โจ #PTerm is a modern Go module to easily beautify console output. Featuring charts, progressbars, tables, trees, text input, select menus and much more ๐ It's completely configurable and 100% cross-platform compatible.
go-edlib - ๐ String comparison and edit distance algorithms library, featuring : Levenshtein, LCS, Hamming, Damerau levenshtein (OSA and Adjacent transpositions algorithms), Jaro-Winkler, Cosine, etc...
asciibird - ASCII Creation
ecoji - Encodes (and decodes) data as emojis
box-cli-maker - Make Highly Customized Boxes for CLI
xid - Parse unicode identifiers
remove_emoji - Remove Emoji for Ruby 2 ~ 3.x / Rails ๐๐ฒ
gomplate - A flexible commandline tool for template rendering. Supports lots of local and remote datasources.
stable - Streaming pretty text table for Golang
wikitable - Wikipedia tables in your terminal
go-wordwrap - A Go (golang) library for wrapping words in a string.