Closed FedeClaudi closed 3 years ago
Technically, you can already use:
from memo import memfunc
from rich import print
@memfunc(callback=print)
def func(foo):
...
But this is not a table.
For a nicely formatted table to standard out we do need the entire dataset, no? Can you print a table row by row in rich?
I see, I clearly need to dig deeper into how memo
works.
Can you print a table row by row in rich?
Not out of the box I don't think but it can be hacked together.
I'm open to a utility method, something like print_pretty_table
, that accepts a list of dictionaries as input and outputs a pretty table. It's something that could also be useful from the commandline.
okay, once I start using memo I will see if I can make something useful. Thanks again for making memo
, looks awesome
It deserves mentioning though that you can already use pd.DataFrame(data)
. Given that pandas already supports a pretty layout, would it really make sense to also offer a rich view?
I'll close the issue for now. Feel free to re-open if need be.
Hi,
This looks great, thanks for making it and sharing it. I will most likely use it in my work. I was wandering if contributions are welcome (there's no license and I didn't see anything about in the docs).
In particular I was thinking of adding the option to use the great Rich library to print nicely formatted tables. So in alternative to
to have something like this from pyinspect:![image](https://user-images.githubusercontent.com/17436313/101768131-1cc83b80-3add-11eb-93a0-57a979222b0b.png)
Let me know if you'd like to receive a PR about this!