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.
When creating a table with `maxcolwidths`, ANSI escape codes sometimes get wrongly split. Here's an example, increasing the length of the "0123..." sequence to show the issue: ```python print(tabulate.tabulate(tabular_data=(('01234 (\x1b[32mabcdefghij\x1b[0m)',...
Currently, a list of dataclasses is supported for tabular data formats, but it would be great to also allow a list of Pydantic models. https://docs.pydantic.dev/latest/concepts/models/
Using a dataset, which contains a field with a None type and a defined maxcolwidths for that field - like the following: ``` headers= ['id', 'name', 'description'] width = [None,...
Before ``` ╭───────┬──────────────────────────────────────────────╮ │ │ File: /tmp/teste.json │ ├───────┼──────────────────────────────────────────────┤ │ 1 │ { │ │ 2 │ "id": "d35c4561-abb3-4fa5-8103-c0a88ca9eb50", │ │ 3 │ "name": "CCat Test", │ │ 4 │...
The following line will fail with an error about "bool' object has no attribute 'expandtabs' tabulate.tabulate([['init','True']], maxcolwidths=[None, 42]) This happens because the _wrap_text_to_col_widths method casts the cell to a casted...
Hi there, How is it possible to change the text/background colour of a table entry? There are several scenarios which I'd like to know how to do this. Ideally this...
Hi, when maxcolwidths is set, and cell has ansi decorated, ValueError will be raised. ***ValueError: invalid literal for int() with base 10: '\x1b[32m44\x1b[37m'*** this pr helps fix it.
coltype autodetection assumes "0.0" is a float and the table shows "0", instead of the string "0.0"
I couldn't find a way to enforce a column type to solve this issue: Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux ``` >>> t = [["First...
Good: ```pycon In [10]: print(t.tabulate([["lorem ipsum dolor sit amet"]*3], tablefmt="grid", maxcolwidths=[12, 8])) +-------------+----------+----------------------------+ | lorem ipsum | lorem | lorem ipsum dolor sit amet | | dolor sit | ipsum...