Python Libraries Cheat Sheet
These are common Python libraries for interactive work and terminal output. Install them inside a virtual environment to keep dependencies isolated per project.
1. Rich
Section titled “1. Rich”Rich formats terminal output with colors, tables, progress bars, panels, and syntax-highlighted tracebacks. Use it in CLI tools and scripts when plain print() is not enough.
1.1 Install
Section titled “1.1 Install”pip install rich1.2 Examples
Section titled “1.2 Examples”Colored output:
from rich import print
print("[bold green]OK[/] [red]Error[/]")2. IPython
Section titled “2. IPython”IPython is an enhanced interactive Python shell (REPL). It adds tab completion, ? help, %magic commands, and better object inspection compared to the standard python interpreter.
2.1 Install
Section titled “2.1 Install”pip install ipython2.2 Launch
Section titled “2.2 Launch”ipython2.3 Common magic commands
Section titled “2.3 Common magic commands”%pwd # print working directory%run script.py # execute a Python file%timeit sum(range(100)) # benchmark an expressionobj? # show help for an objectIPython is also the kernel that powers Jupyter notebooks.
3. JupyterLab
Section titled “3. JupyterLab”JupyterLab is a web-based IDE for notebooks, terminals, and file browsing. It is the primary environment for exploratory Python and data work.
3.1 Install
Section titled “3.1 Install”pip install jupyterlab3.2 Launch
Section titled “3.2 Launch”jupyter labThis opens the JupyterLab UI in your browser. From there you can create .ipynb notebooks with code and markdown cells, run them cell by cell, and inspect outputs inline.
JupyterLab uses IPython as its Python kernel. You can also use Rich inside notebook cells for formatted terminal-style output.