Display Rich Text In The Console Using Python
Are you using the terminal more than GUI-based operating systems? Or, do you usually develop command-line interface programs using Python? Recently, I found an amazing Python library called “Rich” on GitHub, which already has 15.2k stars by the time I’m writing this article.

It can not only display text in colour and styles in the terminal but also emoji, tables, progress bars, markdown and even syntax highlighted code. If you have read one of my previous articles below:

The “Rich” library can almost do everything that I have introduced in that article, as well as some other awesome stuff.

In this article, I’ll introduce this library with examples to show its capabilities.

Introduction & Installation

Image source: https://github.com/willmcgugan/rich (Official GitHub README.md)

The image above shows the major features that the library can do. You can find the project on GitHub:

The library requires Python 3.6.1 or above to be functional. Installing the library is quite simple because we can use pip .

pip install rich

Rich Printing

Let’s first look at how it can print.

Tags and Emoji

It supports formatting tags and emoji.
['Christopher Tao']
['Technology', 'Software Engineering', 'Artificial Intelligence', 'Software Development', 'Programming']