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

Plain text / Terminal formatter #317

Open
davidfischer opened this issue Nov 30, 2017 · 2 comments
Open

Plain text / Terminal formatter #317

davidfischer opened this issue Nov 30, 2017 · 2 comments

Comments

@davidfischer
Copy link

davidfischer commented Nov 30, 2017

I thought I would open an issue to gauge interest in a terminal / plain text formatter. This possible formatter would print or read data from space padded plain text.

import tablib

data = tablib.Dataset()
data.headers = ('first_name', 'last_name')
data.append(('John', 'Adams'))
data.append(('George', 'Washington'))
print data.export('txt')
# first_name           last_name
# John                 Adams
# George               Washington

If you think this is useful and fits with the philosophy of the project, I could put together a PR.

There are definitely some differences between this and some of the other formatters including:

  • how wide should it print by default?
  • if the data is wider than the width, there will be data truncation
  • this can't really losslessly handle (outputting and then reading a dataset will result in differences) data with spaces at the beginning or end
@zobnec
Copy link

zobnec commented Dec 7, 2017

Yeah,I think it's interesting and useful

@Sahnesiguzel33

This comment was marked as spam.

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

3 participants