Python module to create simple ASCII tables from data.
module to create simple ASCII tables
$ python3 -c "from texttable import Texttable; t = Texttable(); t.add_rows([['Name', 'Age'], ['Alice', 30], ['Bob', 25]]); print(t.draw())"$ python3 -c "from texttable import Texttable; t = Texttable(); t.set_cols_align(['l', 'r', 'c']); t.add_rows([['Left', 'Right', 'Center'], ['A', '1', 'X']]); print(t.draw())"$ python3 -c "from texttable import Texttable; t = Texttable(max_width=50); t.set_cols_width([10, 15, 15]); t.add_rows([['Col1', 'Col2', 'Col3'], ['data', 'more', 'info']]); print(t.draw())"$ python3 -c "from texttable import Texttable; t = Texttable(); t.set_deco(Texttable.HEADER | Texttable.VLINES); t.add_rows([['ID', 'Name'], [1, 'Test']]); print(t.draw())"$ python3 -c "import csv; from texttable import Texttable; rows = [['Name', 'Score'], ['Alice', '95'], ['Bob', '87']]; t = Texttable(); t.add_rows(rows); print(t.draw())"