Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-tabulate out dated / forked #384

Closed
meeuw opened this issue Mar 24, 2017 · 6 comments
Closed

python-tabulate out dated / forked #384

meeuw opened this issue Mar 24, 2017 · 6 comments
Assignees

Comments

@meeuw
Copy link
Contributor

meeuw commented Mar 24, 2017

We are using a forked version of tabulate from pgcli and made some modifications for mycli as well.

I've found out from which commit tabulate was forked (a8a670f749c3b0aeaeb5683dfe44665ef19e3d82) and which version from pgcli we're using (560a3fb7c5825ca8a6ef676cc6ced6454f1bbeb2).

I've reconstructed history in this bitbucket branch (python-tabulate is hosted at bitbucket):
https://bitbucket.org/meeuw/python-tabulate/branch/mycli if we would have pushed our commits to upstream.

As you can see we are 95 commits behind python-tabulate/master I'll check if I can merge those changes.

I think it would be great to use python-tabulate as a site-package or a seperately published, forked version for dbcli/mycli.

@amjith
Copy link
Member

amjith commented Mar 24, 2017

@meeuw I think the path forward is to abandon tabulate and use https://github.com/Robpol86/terminaltables/

Terminaltables is a library that provides the absolute minimum for rendering tables. It can handle multi-line values in the cells. So if the output has newlines it will render correctly.

I spiked a prototype a few days ago that I can't find now, but the idea is to use terminaltables to render our tables. But pre-process the rows (by converting the numbers to strings) before passing it into the terminaltables library.

I'll spent a few hours tonight to put up a PR and we can iterate.

@j-bennet
Copy link
Contributor

Ah, great. I'd be very interested to see that.

@meeuw
Copy link
Contributor Author

meeuw commented Mar 24, 2017

That sounds great, but I'm not sure how many people use the different table formats provided by tabulate. Anyway, tabulate's isint/isnumber string detection isn't very helpful for us and I think there are better ways for formatting html/wikitables/tsv etc. I really like the decimal separator alignment in tabulate:

  1.1
 11.1
111.1

I hope terminaltables is capable of this.

@amjith
Copy link
Member

amjith commented Mar 24, 2017

We'll have to find out if it can do the decimal alignment.

@tsroten tsroten self-assigned this Apr 20, 2017
@tsroten
Copy link
Member

tsroten commented May 1, 2017

This was resolved by #388, which will be in the next release.

@tsroten
Copy link
Member

tsroten commented Jul 11, 2017

This is fixed as of version 1.11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants