astanin / python-tabulate

Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
https://pypi.org/project/tabulate/
MIT License
2.09k stars 162 forks source link

Add "flow" tablefmt which doesn't do any formatting #314

Open elric1 opened 5 months ago

elric1 commented 5 months ago

This will help for programs that may have an option to simply output the data without any formatting at all. This is done by first providing defaults to TableFormat. We do this so that fields can be added without breaking the ABI. We then add two fields "align_columns" and "elide_empty_columns". The former stops padding things out to align them and this is also useful for, e.g. HTML. The latter just removes columns where all of the entries are empty. We use those two to define a TableFormat "flow" which just outputs the data joined by " " with no alignment or other formatting.