Rich is a Python library that makes terminal output visually appealing with colors, formatting, and advanced features like tables, progress bars, and syntax highlighting. It enhances readability for command-line tools, scripts, and logs. Rich is commonly used for building CLI applications, debugging, and adding interactive visual elements to console programs without requiring a GUI.
Installation:
pip install rich
Example usage:
from rich.console import Console
from rich.table import Table
console = Console()
table = Table(title="Fruits")
table.add_column("Name", style="cyan")
table.add_column("Quantity", style="magenta")
table.add_row("Apple", "10")
table.add_row("Banana", "20")
console.print(table)
PyPI page: https://pypi.org/project/rich/
GitHub page: https://github.com/Textualize/rich
3 Project Ideas:
- Build a CLI inventory management tool with colorful tables.
- Create a terminal-based dashboard showing real-time statistics.
- Enhance command-line scripts with progress bars and syntax-highlighted logs.
Top comments (0)