python-tabulate
python-tabulate copied to clipboard
Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
I've noticed that [PyPi package](https://pypi.org/project/tabulate/) is last updated at Oct 6 2022, and missing some useful fixes, like for #190. @astanin could you publish a newer version when you have...
Sample script: ``` from tabulate import tabulate table = [["spam", 41.9999], ["eggs", "451.0"], ["sausages", None]] print(tabulate(table, headers='keys', tablefmt='plain')) print(tabulate(table, headers='keys', tablefmt='plain', maxcolwidths=40)) ``` The last line leads to this exception:...
In `tabulate._CustomTextWrap._handle_long_word`, ANSI escape codes may be broken in the middle, resulting wrongly formatted tables. That happens because the length of the string is checked in `while self._len(chunk[:i])
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...
With `tabulate==0.9.0` This code fails: ``` print(tabulate({'x': []}, headers="keys", maxcolwidths=100)) ``` Expected behaviour: Without data, it should render the table as with: ``` print(tabulate({'x': []}, headers="keys")) ```
When using wrapping (i.e. with `maxcolwidths`) with a column that contains None values, the process crashes with the error `TypeError: NoneType takes no arguments`. To solve that, an extra guard...
Also fix Black and Flake8 and upgrade syntax with pyupgrade.
I have a custom formatter for floats. One example feature is that I can format floats to be in exponential notation but to always have an exponent that is a...
Traditionally, I'd rather show a specific placeholder in empty cells to distinguish between absent and a zero value. However, using a string in a column that's been designated as float...
For example: ```python from codecs import encode from string import ascii_uppercase rot13_cipher = [(c, encode(c,'rot13')) for c in ascii_uppercase] tabulate(rot13_cipher, headers = ('input', 'output'), header_pos='left') ``` resulting in ``` +--------++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+...