Pylsy: Python library to represent tabular data in ASCII tables(github.com)
github.com
Pylsy: Python library to represent tabular data in ASCII tables
http://www.github.com/Leviathan1995/Pylsy
24 comments
PrettyTable is an established library which does the same: https://code.google.com/p/prettytable/
I've used PrettyTable for years. I don't see how this improves upon it
Cool!
Sorry for the plug, but this gawk program does something similar:
https://github.com/joepvd/table
Field splitting can be defined with all of (g)awks possibilities. Features different styles, among which unicode table borders.
Sorry for the plug, but this gawk program does something similar:
https://github.com/joepvd/table
Field splitting can be defined with all of (g)awks possibilities. Features different styles, among which unicode table borders.
Nice utility! I've written a quick clone of it in Tcl for use on systems without GNU Awk: http://wiki.tcl.tk/41682.
Aha! That must have been the first time I have tried to read Tcl for more than a minute :) Looks like one can prototype fast in this language. Thanks for writing / posting!
Judging by this thread there are a surprising number of tools dedicated to this. Typically when I need tabular output I stick the data into a Pandas dataframe and its output format is usually good enough.
This is my choice for tables on Python - https://github.com/Robpol86/terminaltables. The appearance of tables is adequately configurable. The project is also actively maintained unlike some of the others.
Incredible how everyone in this thread has a different opinion on what is the best python library that works with table.
Yeah. Probably, the reason is that you can code it easily in few hundred lines and it looks decent and cool.
It's basically this in real time! https://xkcd.com/927/
If anyone interested in similar library in C language, take a look at my simple libTprint library: https://github.com/wizzard/libtprint
Hope it helps!
This recalls some of the table formatting and exporting magic one can easily achieve with emacs org-mode. http://orgmode.org/guide/Tables.html
And there, if you like, you can include a full set of spreadsheet operations.
Cool project. You might be able to use Hypothesis (https://hypothesis.readthedocs.org/en/master/) for testing this to make sure you catch all of the little edge cases.
csvlook [0] is another great tool that does this for any CSV file. It's part of the very useful csvkit[1] suite of command line utilities for working with CSV files.
[0] http://csvkit.readthedocs.org/en/latest/scripts/csvlook.html
[1] http://csvkit.readthedocs.org/en/latest/index.html
[0] http://csvkit.readthedocs.org/en/latest/scripts/csvlook.html
[1] http://csvkit.readthedocs.org/en/latest/index.html
For Rubyists: https://github.com/geemus/formatador
To do this, I would just tab-delimit stdout and pipe through `column -t`. Though I can see how a dedicated lib would be better for some use cases.
Takes up too much (vertical) space.
I agree - perhaps there should be an option to control where and if you want to have the vertical and horizontal lines?
I've tried several of similar libraries, and still find `tabulate` the best.
Suggest a move to "Show HN"
Note the variety of formats: 'ascii', but also html, latex & co.