<h1 align="center" style="font-size:50px;">🔧 Rich Tools</h1>
<p align="center">
<em>A python package with helpful functions for use alongside with the <a href="https://github.com/willmcgugan/rich">rich</a> python library.</em>
</p>
<p align="center">
<a href="https://pypi.org/project/rich-tools/" target="_blank">
<img src="https://badge.fury.io/py/rich-tools.svg" alt="PyPI version">
</a>
<a href="https://badge.fury.io/py/rich_tools"code>
<img src="https://img.shields.io/pypi/pyversions/rich_tools" alt="Supported Python Versions">
</a>
<a href="https://github.com/avi-perl/rich_tools/actions/workflows/test.yml" target="_blank">
<img src="https://github.com/avi-perl/rich_tools/actions/workflows/test.yml/badge.svg" alt="Test">
</a>
<a href="https://codecov.io/gh/avi-perl/rich_tools" target="_blank">
<img src="https://codecov.io/gh/avi-perl/rich_tools/branch/master/graph/badge.svg?token=7A5RYLZ37B"/>
</a>
<a href="https://twitter.com/__aviperl__" target="_blank">
<img src="https://badgen.net/badge/icon/twitter?icon=twitter&label=Chat%20with%20me" alt="Twitter">
</a>
</p>
---
#### The current features are:
- **Convert a [Pandas](https://pandas.pydata.org/) DataFrame into a [rich](https://github.com/willmcgugan/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](https://github.com/willmcgugan/rich) Table into a [Pandas](https://pandas.pydata.org/) 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](https://github.com/willmcgugan/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](https://github.com/willmcgugan/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
```bash
$ pip install rich-tools
```
### Example
Additional examples can be found in the [examples](examples) dir.
```python
# 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](https://github.com/willmcgugan/rich) package itself, its creator [Will McGugan](https://twitter.com/willmcgugan)
is awesome! Check out [Textual](https://github.com/willmcgugan/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](https://github.com/avi-perl/rich_tools/graphs/contributors) and learn more about contributing [here](CONTRIBUTING.md).
Raw data
{
"_id": null,
"home_page": "https://github.com/avi-perl/rich_tools",
"name": "rich-tools",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "rich, pandas",
"author": "Avi Perl",
"author_email": "avi@aviperl.me",
"download_url": "https://files.pythonhosted.org/packages/fc/ed/5350411b9469495876dcce267fd35bbdc63bd502f1fd5fd914248cbb60d8/rich_tools-0.5.1.tar.gz",
"platform": null,
"description": "<h1 align=\"center\" style=\"font-size:50px;\">\ud83d\udd27 Rich Tools</h1>\n<p align=\"center\">\n <em>A python package with helpful functions for use alongside with the <a href=\"https://github.com/willmcgugan/rich\">rich</a> python library.</em>\n</p>\n<p align=\"center\">\n<a href=\"https://pypi.org/project/rich-tools/\" target=\"_blank\">\n <img src=\"https://badge.fury.io/py/rich-tools.svg\" alt=\"PyPI version\">\n</a>\n<a href=\"https://badge.fury.io/py/rich_tools\"code>\n <img src=\"https://img.shields.io/pypi/pyversions/rich_tools\" alt=\"Supported Python Versions\">\n</a>\n<a href=\"https://github.com/avi-perl/rich_tools/actions/workflows/test.yml\" target=\"_blank\">\n <img src=\"https://github.com/avi-perl/rich_tools/actions/workflows/test.yml/badge.svg\" alt=\"Test\">\n</a>\n<a href=\"https://codecov.io/gh/avi-perl/rich_tools\" target=\"_blank\">\n <img src=\"https://codecov.io/gh/avi-perl/rich_tools/branch/master/graph/badge.svg?token=7A5RYLZ37B\"/>\n</a>\n\udb40\udc20\udb40\udc20\n<a href=\"https://twitter.com/__aviperl__\" target=\"_blank\">\n <img src=\"https://badgen.net/badge/icon/twitter?icon=twitter&label=Chat%20with%20me\" alt=\"Twitter\">\n</a>\n</p>\n\n---\n\n#### The current features are:\n\n- **Convert a [Pandas](https://pandas.pydata.org/) DataFrame into a [rich](https://github.com/willmcgugan/rich) Table \u279c `df_to_table()`**\n\n By making this conversion, we can now pretty print a DataFrame in the terminal with rich. Bridging the gap between \n pandas and rich also provides a path for loading external data into a rich Table using Pandas functions such as `.from_csv()`!\n- **Convert a [rich](https://github.com/willmcgugan/rich) Table into a [Pandas](https://pandas.pydata.org/) DataFrame \u279c `table_to_df()`**\n\n By bridging the gap between a rich Table and a DataFrame, we can now take additional actions on our data such as \n saving the data to a csv using the Pandas function `.to_csv()`!\n- **Convert a [rich](https://github.com/willmcgugan/rich) Table into a list of dictionaries. \u279c `table_to_dicts()`**\n\n Get your tables rows as a list of dictionaries with column names as key, and row contents as values.\n- **Strip [rich](https://github.com/willmcgugan/rich) markup tags from a string. \u279c `strip_markup_tags()`**\n\n Helper function to remove tags from text formatted with rich. `\"[bold]Bold[/bold]\"` becomes `\"Bold\"`\n\n### Installation\n```bash\n$ pip install rich-tools\n```\n\n### Example\nAdditional examples can be found in the [examples](examples) dir.\n```python\n# Print csv data to the terminal as a pretty printed rich formatted table\n\nimport pandas as pd\nfrom rich import print\nfrom rich_tools import df_to_table\n\nif __name__ == '__main__':\n df = pd.read_csv(\"sample_input.csv\")\n table = df_to_table(df)\n print(table)\n\n```\n\n### Credits\n- Like the [rich](https://github.com/willmcgugan/rich) package itself, its creator [Will McGugan](https://twitter.com/willmcgugan)\nis awesome! Check out [Textual](https://github.com/willmcgugan/textual) \"a TUI (Text User Interface) framework for \nPython inspired by modern web development\". Thank you for the advice you've given on this project! \ud83d\ude4f\n- I am grateful for folks who give some of their time to this project in any form. Check out the list of \n[contributors](https://github.com/avi-perl/rich_tools/graphs/contributors) and learn more about contributing [here](CONTRIBUTING.md).",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python package with helpful tools when working with the rich python library.",
"version": "0.5.1",
"project_urls": {
"Homepage": "https://github.com/avi-perl/rich_tools",
"Repository": "https://github.com/avi-perl/rich_tools"
},
"split_keywords": [
"rich",
" pandas"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8d9adc79827022336b070704250ffff484c8b35d13ad47ffaae6dfb626c23288",
"md5": "867f047d885cf82f0a711d3cd575ce3f",
"sha256": "f13dbaab74681c07d965902b2432af85568219ed5bce42d670d113836bb87272"
},
"downloads": -1,
"filename": "rich_tools-0.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "867f047d885cf82f0a711d3cd575ce3f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 5434,
"upload_time": "2024-09-10T01:12:27",
"upload_time_iso_8601": "2024-09-10T01:12:27.450064Z",
"url": "https://files.pythonhosted.org/packages/8d/9a/dc79827022336b070704250ffff484c8b35d13ad47ffaae6dfb626c23288/rich_tools-0.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fced5350411b9469495876dcce267fd35bbdc63bd502f1fd5fd914248cbb60d8",
"md5": "c65e7921e11feae12ba64cc619a1d6bf",
"sha256": "ca30da26b8fe0a5af2e5c0b5fba1c3a0bdf40b52de62fdf99d0662db62e063b5"
},
"downloads": -1,
"filename": "rich_tools-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "c65e7921e11feae12ba64cc619a1d6bf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 4875,
"upload_time": "2024-09-10T01:12:28",
"upload_time_iso_8601": "2024-09-10T01:12:28.940372Z",
"url": "https://files.pythonhosted.org/packages/fc/ed/5350411b9469495876dcce267fd35bbdc63bd502f1fd5fd914248cbb60d8/rich_tools-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-10 01:12:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "avi-perl",
"github_project": "rich_tools",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "rich-tools"
}