I'm trying to print a python dict in tabular format but facing difficulty in working with dict. Following is my dict:
board_dict =
{
'Done': {
'point': 0.0,
'items': 1
},
'Doing': {
'point': 24.0,
'items': 3
},
'New': {
'point': 0.0,
'items': 2
},
'Stuck': {
'point': 19.0,
'items': 3
},
'Ready to Test': {
'point': Decimal('1'),
'items': 1
}
}
I'm trying to design something like this:
Column Items Points
------ ----- ------
Sprint Backlog 0 0
Doing 3 24
Stuck 3 19
Code Review 0 0
Ready to Test 1 1
Done 1 0
------
Total 8 44
------
I have tried the following using python tabulate
https://pypi.org/project/tabulate/
print(tabulate(board_dict, headers="keys", tablefmt="fancy_grid"))
╒════════╤═════════╤═══════╤═════════╤═════════════════╕
│ Done │ Doing │ New │ Stuck │ Ready to Test │
╞════════╪═════════╪═══════╪═════════╪═════════════════╡
│ point │ point │ point │ point │ point │
├────────┼─────────┼───────┼─────────┼─────────────────┤
│ items │ items │ items │ items │ items │
╘════════╧═════════╧═══════╧═════════╧═════════════════╛
Any help will be much appriciated.