Skip to content

Plain text / Terminal formatter #317

@davidfischer

Description

@davidfischer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions