Other great tools in the python terminal sphere are colorama, blessings and urwid.
Colorama is just for cross platform colouring, blessings is a very elegant wrapper over curses which is still useful for not-fullscreen things, and urwid is a full-blown widget library for TUI stuff.
Reminds me of my own Marked-Man utility [1], but this is way prettier. Definitely will have to check this out. Maybe I'll redo marked-man with this lib.
This looks great. I love stuff like this, especially that it is cross platform. One thing that would be nice to see is a list of which terminals are supported, or at least what the various terminals support.
Rich has already become my go-to tool for various Python stuff. I use these days Code's Python file with notebook cell comments. With this I can use console and Jupyter Notebook style rendering depending on wether I'm using regular IPython or Code's Interactive Window. I'm adapting my console printing to leverage Rich's features for Django querysets and other objects I'm dealing with. Rich gives me poor man's Jupyter Notebook widgets. Now I don't need to switch to ipynb files for browser based JS widgets much at all.
Related to this - is there a way to have a similar rich-styling library designed for email outputs?
I have some daily reports generated by a python script via cron. The script currently outputs plaintext and the email just adds <pre> tags around the output, for formatting purposes. Some spicier formatting would be nice.
Excellent ! Really love the traceback coloration, would love to have that enabled by default, should probably check pythonrc if it can hook that up. Also, RST support would be nice to render docstrings. Also, nice sphinx docs dir, perhaps enable rtfd.io or something that will publish them somewhere as HTML ?
Well I have just finished a sub-optimal color implementation with also my own print() implementation in https://yourlabs.io/oss/cli2 and I'd be willing to throw another week at it, but didn't really identify how rich could help exactly, if you want to open a ticket there then we can start a discussion
This is great! Will certainly be using it in all my command line tools and scripts. Particularly the log handler. Also, like how it has special support for Jupyter notebooks.
Colorama is just for cross platform colouring, blessings is a very elegant wrapper over curses which is still useful for not-fullscreen things, and urwid is a full-blown widget library for TUI stuff.