Jaymon / captain

command line python scripts for humans
MIT License
13 stars 1 forks source link

output.table with dictionaries #65

Closed Jaymon closed 1 year ago

Jaymon commented 3 years ago

One day, sometime in the far future probably, I will actually be able to use this method and have it actually print what I was expecting, this time:

ds = [
    {
        "foo": 1,
        "bar": "one",
    },
    {
        "foo": 2,
        "bar": "two",
    },
]

self.output.table(ds)

I would want this to print:

| foo |  bar  |
| 1     |  one |
| 2     |  two |

but alas, it didn't, instead I got:

| foo |  bar  |
| foo |  bar  |

sigh