Since I would like to begin working on #218 (Add --full-pubkey option), I would like to know if you chose. Tabulate is used in almost every command except history.
If we have to choose, maybe we should set a list of criteria. I begin.
tl;dr : both are very similar. Good point for Tabulate is styles. Good point for texttable is max width of tables. I would search a workaround to use a max width with tabulate.
Criteria to be checked
Assign a maximum width for the table
texttable. It is used in history, it is great on small display.
tabulate can't. On small display, tables wrap strangely and are difficult to read. We could find a workaround, but it would be quite annoying.
texttable has only one style, we can choose to use only/combine headers, columns, lines, borders (see set_deco)
tabulate has much more available styles.
note : some users include silkaj in scripts, and parse the output. Having custom characters like those used by tabulate styles is not very nice to them.
Thank you very much for this investigation That's very valuable to do this kind of researches.
Assign a maximum width for the table
That might be the reason why I didn't manage to use tabulate for the history command, and I looked for an alternative. I remember I had a hard time organizing the data structure, and with texttable I was able to pass a different form of data structure (list of list, dict of list, or list of dict, I do not remember), which made it works.
Regarding #218 (Add --full-pubkey option). If this is a priority for you, please go on. Do it, that shouldn't change that much the code. texttable or tabulate and the absence of unit tests shouldn't make a big difference. Create a ticket for this particular feature and link it in #218.
OK. I have (partially) found and adapted a wrapper around tabulate, to make it adjust to the screen's size. BUT :
it is pretty complicated (the original code is to create... a full table. sic. why would we use tabulate ?)
I encountered lots of glitches (one character too long for a line, one too short for the other, columns too large, etc.) that could not be easily debugged. It is not a good idea to add this complexity to Silkaj.
Meanwhile, I could get pretty nice tables with texttable. I published the code to play with here : $571 .
───────────────────────────────────────────────────────────────────│ Public key │ amount │ sent │───────────────────────────────────────────────────────────────────│ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN:FVm │ 5000.4 │ Yes │───────────────────────────────────────────────────────────────────│ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN:FVm │ 0.0 │ No │───────────────────────────────────────────────────────────────────│ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN:FVm │ 18.0 │ No │───────────────────────────────────────────────────────────────────with width = 60(note that the vertical lines are displayed as continuous on my tty emulator)────────────────────────────────────────────────────────────│ Public key │ amount │ sent │────────────────────────────────────────────────────────────│ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76 │ 5000.4 │ Yes ││ LRN:FVm │ │ │────────────────────────────────────────────────────────────│ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76 │ 0.0 │ No ││ LRN:FVm │ │ │────────────────────────────────────────────────────────────│ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76 │ 18.0 │ No ││ LRN:FVm │ │ │────────────────────────────────────────────────────────────│──────────────────────────────────────────│────────│──────││ Public key │ amount │ sent ││══════════════════════════════════════════│════════│══════││ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76 │ 5000.4 │ Yes ││ LRN:FVm │ │ ││──────────────────────────────────────────│────────│──────││ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76 │ 0.0 │ No ││ LRN:FVm │ │ ││──────────────────────────────────────────│────────│──────││ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76 │ 18.0 │ No ││ LRN:FVm │ │ ││──────────────────────────────────────────│────────│──────│