-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Python Rich Library\n", | ||
"\n", | ||
"This notebook is a quick overview of the Python Rich library. Rich is a Python library for rich text and beautiful formatting in the terminal. It is a great tool for creating beautiful and interactive text-based interfaces.\n", | ||
"\n", | ||
"- [Rich Documentation](https://rich.readthedocs.io/en/latest/)\n", | ||
"- [GitHub Source and Demos](https://github.com/Textualize/rich)\n", | ||
"\n", | ||
"## Installation\n", | ||
"\n", | ||
"You can install the Rich library using pip:\n", | ||
"\n", | ||
"```bash\n", | ||
"pip install rich\n", | ||
"```\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"! pip install rich" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from rich import print" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">🔥 Hello, <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">World</span>! 🧛\n", | ||
"</pre>\n" | ||
], | ||
"text/plain": [ | ||
"🔥 Hello, \u001b[1;35mWorld\u001b[0m! 🧛\n" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"print(\":fire: Hello, [bold magenta]World[/bold magenta]!\", \":vampire:\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Go through the following Examples on a Terminal\n", | ||
"\n", | ||
"- run the following examples from command line\n", | ||
"\n", | ||
"```bash\n", | ||
"$ python -m rich.table\n", | ||
"$ python -m rich.progress\n", | ||
"$ python -m rich.status\n", | ||
"$ python -m rich.columns\n", | ||
"$ python -m rich.tree\n", | ||
"$ python -m rich.panel\n", | ||
"$ python -m rich.box\n", | ||
"```\n", | ||
"\n", | ||
"- look at examples from GitHub source\n", | ||
"\n", | ||
"- Console API\n", | ||
"- Styles\n", | ||
"- Prompt\n", | ||
"- Progress\n", | ||
"- Table\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |