🔧 Rich Tools
A python package with helpful functions for use alongside with the rich python library.
The current features are:
-
Convert a Pandas DataFrame into a rich Table ➜
df_to_table()By making this conversion, we can now pretty print a DataFrame in the terminal with rich. Bridging the gap between pandas and rich also provides a path for loading external data into a rich Table using Pandas functions such as
.from_csv()! -
Convert a rich Table into a Pandas DataFrame ➜
table_to_df()By bridging the gap between a rich Table and a DataFrame, we can now take additional actions on our data such as
saving the data to a csv using the Pandas function.to_csv()! -
Convert a rich Table into a list of dictionaries. ➜
table_to_dicts()Get your tables rows as a list of dictionaries with column names as key, and row contents as values.
-
Strip rich markup tags from a string. ➜
strip_markup_tags()Helper function to remove tags from text formatted with rich.
"[bold]Bold[/bold]"becomes"Bold"
Installation
$ pip install rich-tools
Example
Additional examples can be found in the examples dir.
# Print csv data to the terminal as a pretty printed rich formatted table
import pandas as pd
from rich import print
from rich_tools import df_to_table
if __name__ == '__main__':
df = pd.read_csv("sample_input.csv")
table = df_to_table(df)
print(table)
Credits
- Like the rich package itself, its creator Will McGugan is awesome! Check out Textual "a TUI (Text User Interface) framework for Python inspired by modern web development". Thank you for the advice you've given on this project! 🙏
- I am grateful for folks who give some of their time to this project in any form. Check out the list of contributors and learn more about contributing here.
Metadata
Release files for rich-tools 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rich_tools-0.6.0.tar.gz | 4.8 kB | Without provenance | Details for rich_tools-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rich_tools-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for rich_tools-0.6.0-py3-none-any.whl |
Total release size: 10.1 kB
Release files / rich_tools-0.6.0.tar.gz
| Download URL | rich_tools-0.6.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
039fd87b076bf2d4fcd30e3a9b4b561b67d3ca98a1ffdb49416cb74e566896fc
|
|
BLAKE2b-256 checksum How to use checksums |
1a81e7b5dae7aa5bdf89a833845fdd12d5f1e0d622f308298f8a664f65bc0f5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.6 Windows/11
|
Release files / rich_tools-0.6.0-py3-none-any.whl
| Download URL | rich_tools-0.6.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a6971af5821c63f1d3fceb777b91f2e1215c3b9a086b00b0b78231306a40851
|
|
BLAKE2b-256 checksum How to use checksums |
c5f40d88dd4ce83b789194900b0713a58573f8b66a016b99b1004a2e84f95fe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.6 Windows/11
|
Security for rich-tools 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.