utils.display module
Make output prettier and work with tables
- utils.display.print_simple_to_fancy_table(text: str, has_header: bool = True, columns: List[str] = None) str
Generates and prints a fancy table from the given boring table
A boring table is one in the format: ColHead1 ColHead2 row01val1 row1v2 row2val1 row2v2
It may or may not be column-aligned.
The generated table is both returned and printed.
- utils.display.print_table(table: List[Dict], columns: List[str] = None) str
Given a table in
parse_table()format (a list of dicts), prints it nicelyIf
columnsis given, only the given keys will be in the table. Ifcolumnsis None, all keys from the list table row will be used.The generated table is both returned and printed.
- utils.display.table_to_string(table: List[Dict], columns: List[str] = None) str
Given a table in
parse_table()format (a list of dicts), returns a string representationIf
columnsis given, only the given keys will be in the table. Ifcolumnsis None, all keys from the list table row will be used.