ConsoleTable¶
-
class
tfsnippet.utils.
ConsoleTable
(col_count, col_space=3, col_align=None, expand_col=0)¶ Bases:
object
A class to help format a console table.
Methods Summary
add_config
(config[, sort_keys])Add a config to the table. add_dict
(key_values[, sort_keys])Add a key-value sequence to the table. add_hr
([c])Add a horizon line. add_key_values
(key_values[, sort_keys])Add a key-value sequence to the table. add_row
(columns)Add a row with full columns. add_skip
()Add an empty row. add_title
(title[, top_right])Add row of title. format
()Format the table to string. Methods Documentation
-
add_config
(config, sort_keys=False)¶ Add a config to the table.
Parameters:
-
add_dict
(key_values, sort_keys=False)¶ Add a key-value sequence to the table.
Parameters: - key_values – Dict, or key-value sequence.
- sort_keys (bool) – Whether or not to sort the keys?
-
add_key_values
(key_values, sort_keys=False)¶ Add a key-value sequence to the table.
Parameters: - key_values – Dict, or key-value sequence.
- sort_keys (bool) – Whether or not to sort the keys?
-
add_row
(columns)¶ Add a row with full columns.
Parameters: columns (Iterable[str]) – The column contents.
-
add_skip
()¶ Add an empty row.
-
add_title
(title, top_right=None)¶ Add row of title.
Parameters:
-