Open prjemian opened 3 weeks ago
suggest this code example:
def kv_table(kvdict):
table = pyRestTable.Table()
table.labels = "key value".split()
table.rows = [(k, v) for k, v in kvdict.items()]
return table
Note that the existing dict_to_table()
method is for a different data model, where the keys are column labels and len(each_value)
> 0 and the same for all keys. (Such as a named data arrays.)
For a simple key:value dictionary, such as:
Make it easier to build this table: