Making context outputs more elegant is the challenge for almost everyone wherever they go: console, web, mobile or graphical.
The Rich library is the most innovative in this regard and your TUI apps will look even more professional!
This API makes it easy to add color and style to terminal output. It can also render beautiful tables, progress bars, markdown, syntax highlighted source code, tracebacks and more - ready to use.
To install it is very simple, just use pip, you can install only for your user:
Or for your entire system
At first you can see all the formatting possibilities by running the command:
The output will be something like:
Another basic example of usage, using style and hexadecimal colors: vim hello.py
Run: python hello.py, exit:
You can even use HTML-style tags, but with square brackets, for example:
In addition to tables, see this gif:
Access the repository on GitHub and learn more: