
Pylsy: Python library to represent tabular data in ASCII tables - leviathan1995
http://www.github.com/Leviathan1995/Pylsy
======
bru
Isn't that exactly what tabulate has been doing very well for a while?
[https://pypi.python.org/pypi/tabulate](https://pypi.python.org/pypi/tabulate)

Note the variety of formats: 'ascii', but also html, latex & co.

~~~
IanCal
Tabulate is also excellent for the command line tool it provides, I use it to
convert csv output into tables for GH comments all the time.

------
viraptor
PrettyTable is an established library which does the same:
[https://code.google.com/p/prettytable/](https://code.google.com/p/prettytable/)

~~~
roddux
The introduction is almost identical: '[Pylsy/PrettyTable] is a simple Python
library designed to make it quick and easy to represent tabular data in
visually appealing ASCII tables'

~~~
cryon
I noticed that too. The copy paste is strong in this one.

------
joepvd
Cool!

Sorry for the plug, but this gawk program does something similar:

[https://github.com/joepvd/table](https://github.com/joepvd/table)

Field splitting can be defined with all of (g)awks possibilities. Features
different styles, among which unicode table borders.

~~~
networked
Nice utility! I've written a quick clone of it in Tcl for use on systems
without GNU Awk: [http://wiki.tcl.tk/41682](http://wiki.tcl.tk/41682).

~~~
joepvd
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!

------
kbd
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.

------
mih
This is my choice for tables on Python -
[https://github.com/Robpol86/terminaltables](https://github.com/Robpol86/terminaltables).
The appearance of tables is adequately configurable. The project is also
actively maintained unlike some of the others.

------
ORioN63
Incredible how everyone in this thread has a different opinion on what is the
best python library that works with table.

~~~
jiri
Yeah. Probably, the reason is that you can code it easily in few hundred lines
and it looks decent and cool.

------
wizzardy
If anyone interested in similar library in C language, take a look at my
simple libTprint library:
[https://github.com/wizzard/libtprint](https://github.com/wizzard/libtprint)
Hope it helps!

------
theophrastus
This recalls some of the table formatting and exporting magic one can easily
achieve with emacs org-mode.
[http://orgmode.org/guide/Tables.html](http://orgmode.org/guide/Tables.html)
And there, if you like, you can include a full set of spreadsheet operations.

------
calpaterson
Cool project. You might be able to use Hypothesis
([https://hypothesis.readthedocs.org/en/master/](https://hypothesis.readthedocs.org/en/master/))
for testing this to make sure you catch all of the little edge cases.

------
skept
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](http://csvkit.readthedocs.org/en/latest/scripts/csvlook.html)

[1]
[http://csvkit.readthedocs.org/en/latest/index.html](http://csvkit.readthedocs.org/en/latest/index.html)

------
nahiluhmot
For Rubyists:
[https://github.com/geemus/formatador](https://github.com/geemus/formatador)

------
smellf
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.

------
BetaCygni
Takes up too much (vertical) space.

~~~
asgard1024
I agree - perhaps there should be an option to control where and if you want
to have the vertical and horizontal lines?

------
ipozgaj
I've tried several of similar libraries, and still find `tabulate` the best.

------
mpdehaan2
Suggest a move to "Show HN"

