gt-extras


Namegt-extras JSON
Version 0.0.5 PyPI version JSON
download
home_pageNone
SummaryProvides additional functions for creating beautiful tables with 'great-tables'.
upload_time2025-07-09 13:43:29
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2025 gt-extras contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords tables html
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gt-extras

[![Python Versions](https://img.shields.io/pypi/pyversions/gt_extras.svg)](https://pypi.python.org/pypi/gt-extras)
[![PyPI](https://img.shields.io/pypi/v/gt-extras?logo=python&logoColor=white&color=orange)](https://pypi.org/project/gt-extras/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/gt-extras)](https://pypistats.org/packages/gt-extras)
[![License](https://img.shields.io/github/license/posit-dev/gt-extras)](https://github.com/posit-dev/gt-extras/blob/main/LICENSE)

[![Tests](https://github.com/posit-dev/gt-extras/actions/workflows/ci_tests.yml/badge.svg)](https://github.com/posit-dev/gt-extras/actions/workflows/ci_tests.yml)
[![Documentation](https://img.shields.io/badge/docs-project_website-blue.svg)](https://posit-dev.github.io/gt-extras)
[![Repo Status](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![Contributors](https://img.shields.io/github/contributors/posit-dev/gt-extras)](https://github.com/posit-dev/gt-extras/graphs/contributors)

<!-- [![Codecov](https://codecov.io/gh/posit-dev/gt-extras/branch/main/graph/badge.svg)](https://codecov.io/gh/posit-dev/gt-extras) -->


> ⚠️ **gt-extras is currently in development, expect breaking changes.**


### What is [gt-extras](https://posit-dev.github.io/gt-extras)?

A collection of additional helper functions for creating beautiful tables with the [great-tables](https://posit-dev.github.io/great-tables/) package in Python.

The functions in **gt-extras** are designed to make it easier to add plots, icons, color gradients, and other enhancements to your tables. We wrap up common patterns and boilerplate so you can focus on your data and presentation. It is based on the R package [gtExtras](https://jthomasmock.github.io/gtExtras/index.html), which was designed with a similar goal in mind.

## Installation
Install the latest release from PyPI: ```pip install gt-extras```

## Example Usage

```python
from great_tables import GT
from great_tables.data import gtcars
import gt_extras as gte

gtcars_mini = gtcars.iloc[5:15].copy().reset_index(drop=True)
gtcars_mini["efficiency"] = gtcars_mini["mpg_c"] / gtcars_mini["hp"] * 100

(
    # Start with a standard GT
    GT(gtcars_mini, rowname_col="model")
    .tab_stubhead(label="Vehicle")
    .cols_hide(["drivetrain", "hp_rpm", "trq_rpm", "trim", "bdy_style", "msrp", "trsmn", "ctry_origin"])
    .cols_align("center")
    .tab_header(title="Car Performance Review", subtitle="Using gt-extras functionality")

    # Add gt-extras features using gt.pipe()
    .pipe(gte.gt_color_box, columns=["hp", "trq"], palette=["lightblue", "darkblue"])
    .pipe(gte.gt_plt_dot, category_col="mfr", data_col="efficiency", domain=[0, 0])
    .pipe(gte.gt_plt_bar, columns=["mpg_c", "mpg_h"])
    .pipe(gte.gt_fa_rating, columns="efficiency")
    .pipe(gte.gt_hulk_col_numeric, columns="year", palette="viridis")
    .pipe(gte.gt_theme_538)
)
```

<!-- TODO here!!! -->
<div align="center">
<img src="https://posit-dev.github.io/gt-extras/assets/composite_car_example.png" width="800px">
</div>

## Features

- Apply color gradients and highlights
- Add plots to table cells for visual data representation
- Embed FontAwesome icons
- Use pre-built themes for quick styling
- Utilize helper utilities for common table tasks

## Contributing
If you encounter a bug, have usage questions, or want to share ideas to make this package better, please feel free to file an [issue](https://github.com/posit-dev/gt-extras/issues).

## Code of Conduct
Please note that the **gt-extras** project is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).<br>By participating in this project you agree to abide by its terms.


## 📄 License

**Great Tables** is licensed under the MIT license.

© Posit Software, PBC.

## Citation
If you use **gt-extras** in your work, please cite the package:

```bibtex
@software{gt_extras,
authors = {Jules Walzer-Goldfeld, Michael Chow, and Rich Iannone},
license = {MIT},
title = {{gt-extras: Extra helpers for great-tables in Python.}},
url = {https://github.com/posit-dev/gt-extras}, version = {0.0.1}
}
```

For more information, see the [docs](https://posit-dev.github.io/gt-extras/reference) or [open an issue](https://github.com/posit-dev/gt-extras/issues) with questions or suggestions!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gt-extras",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "tables, html",
    "author": null,
    "author_email": "Jules Walzer-Goldfeld <jules.walzergoldfeld@gmail.com>, Michael Chow <mc_al_github@fastmail.com>, Rich Iannone <rich@posit.co>",
    "download_url": "https://files.pythonhosted.org/packages/1e/f0/3ef331f76bcf19e8ee85f60df7a5542f4c93ddf1e18533e534afba52c305/gt_extras-0.0.5.tar.gz",
    "platform": null,
    "description": "# gt-extras\n\n[![Python Versions](https://img.shields.io/pypi/pyversions/gt_extras.svg)](https://pypi.python.org/pypi/gt-extras)\n[![PyPI](https://img.shields.io/pypi/v/gt-extras?logo=python&logoColor=white&color=orange)](https://pypi.org/project/gt-extras/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/gt-extras)](https://pypistats.org/packages/gt-extras)\n[![License](https://img.shields.io/github/license/posit-dev/gt-extras)](https://github.com/posit-dev/gt-extras/blob/main/LICENSE)\n\n[![Tests](https://github.com/posit-dev/gt-extras/actions/workflows/ci_tests.yml/badge.svg)](https://github.com/posit-dev/gt-extras/actions/workflows/ci_tests.yml)\n[![Documentation](https://img.shields.io/badge/docs-project_website-blue.svg)](https://posit-dev.github.io/gt-extras)\n[![Repo Status](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n[![Contributors](https://img.shields.io/github/contributors/posit-dev/gt-extras)](https://github.com/posit-dev/gt-extras/graphs/contributors)\n\n<!-- [![Codecov](https://codecov.io/gh/posit-dev/gt-extras/branch/main/graph/badge.svg)](https://codecov.io/gh/posit-dev/gt-extras) -->\n\n\n> \u26a0\ufe0f **gt-extras is currently in development, expect breaking changes.**\n\n\n### What is [gt-extras](https://posit-dev.github.io/gt-extras)?\n\nA collection of additional helper functions for creating beautiful tables with the [great-tables](https://posit-dev.github.io/great-tables/) package in Python.\n\nThe functions in **gt-extras** are designed to make it easier to add plots, icons, color gradients, and other enhancements to your tables. We wrap up common patterns and boilerplate so you can focus on your data and presentation. It is based on the R package [gtExtras](https://jthomasmock.github.io/gtExtras/index.html), which was designed with a similar goal in mind.\n\n## Installation\nInstall the latest release from PyPI: ```pip install gt-extras```\n\n## Example Usage\n\n```python\nfrom great_tables import GT\nfrom great_tables.data import gtcars\nimport gt_extras as gte\n\ngtcars_mini = gtcars.iloc[5:15].copy().reset_index(drop=True)\ngtcars_mini[\"efficiency\"] = gtcars_mini[\"mpg_c\"] / gtcars_mini[\"hp\"] * 100\n\n(\n    # Start with a standard GT\n    GT(gtcars_mini, rowname_col=\"model\")\n    .tab_stubhead(label=\"Vehicle\")\n    .cols_hide([\"drivetrain\", \"hp_rpm\", \"trq_rpm\", \"trim\", \"bdy_style\", \"msrp\", \"trsmn\", \"ctry_origin\"])\n    .cols_align(\"center\")\n    .tab_header(title=\"Car Performance Review\", subtitle=\"Using gt-extras functionality\")\n\n    # Add gt-extras features using gt.pipe()\n    .pipe(gte.gt_color_box, columns=[\"hp\", \"trq\"], palette=[\"lightblue\", \"darkblue\"])\n    .pipe(gte.gt_plt_dot, category_col=\"mfr\", data_col=\"efficiency\", domain=[0, 0])\n    .pipe(gte.gt_plt_bar, columns=[\"mpg_c\", \"mpg_h\"])\n    .pipe(gte.gt_fa_rating, columns=\"efficiency\")\n    .pipe(gte.gt_hulk_col_numeric, columns=\"year\", palette=\"viridis\")\n    .pipe(gte.gt_theme_538)\n)\n```\n\n<!-- TODO here!!! -->\n<div align=\"center\">\n<img src=\"https://posit-dev.github.io/gt-extras/assets/composite_car_example.png\" width=\"800px\">\n</div>\n\n## Features\n\n- Apply color gradients and highlights\n- Add plots to table cells for visual data representation\n- Embed FontAwesome icons\n- Use pre-built themes for quick styling\n- Utilize helper utilities for common table tasks\n\n## Contributing\nIf you encounter a bug, have usage questions, or want to share ideas to make this package better, please feel free to file an [issue](https://github.com/posit-dev/gt-extras/issues).\n\n## Code of Conduct\nPlease note that the **gt-extras** project is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).<br>By participating in this project you agree to abide by its terms.\n\n\n## \ud83d\udcc4 License\n\n**Great Tables** is licensed under the MIT license.\n\n\u00a9 Posit Software, PBC.\n\n## Citation\nIf you use **gt-extras** in your work, please cite the package:\n\n```bibtex\n@software{gt_extras,\nauthors = {Jules Walzer-Goldfeld, Michael Chow, and Rich Iannone},\nlicense = {MIT},\ntitle = {{gt-extras: Extra helpers for great-tables in Python.}},\nurl = {https://github.com/posit-dev/gt-extras}, version = {0.0.1}\n}\n```\n\nFor more information, see the [docs](https://posit-dev.github.io/gt-extras/reference) or [open an issue](https://github.com/posit-dev/gt-extras/issues) with questions or suggestions!\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 gt-extras contributors\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Provides additional functions for creating beautiful tables with 'great-tables'.",
    "version": "0.0.5",
    "project_urls": null,
    "split_keywords": [
        "tables",
        " html"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a68541b4595c6278cec330cbbe8054a5953760e2ea25edfb0f4d7d7532251230",
                "md5": "a8ccd9fd59687ab90799aef4ece17d8b",
                "sha256": "606601c46e01071d5e617d1f54e68403e39b933706e29ac0ccf9823beece98c6"
            },
            "downloads": -1,
            "filename": "gt_extras-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a8ccd9fd59687ab90799aef4ece17d8b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 57907,
            "upload_time": "2025-07-09T13:43:28",
            "upload_time_iso_8601": "2025-07-09T13:43:28.725418Z",
            "url": "https://files.pythonhosted.org/packages/a6/85/41b4595c6278cec330cbbe8054a5953760e2ea25edfb0f4d7d7532251230/gt_extras-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1ef03ef331f76bcf19e8ee85f60df7a5542f4c93ddf1e18533e534afba52c305",
                "md5": "c653a22e43432338e88c0b8fbfcc56bd",
                "sha256": "ad2c20282fb799465652793a186fb9a03e811d4ce55989911872c808fb5c3a73"
            },
            "downloads": -1,
            "filename": "gt_extras-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "c653a22e43432338e88c0b8fbfcc56bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 1024766,
            "upload_time": "2025-07-09T13:43:29",
            "upload_time_iso_8601": "2025-07-09T13:43:29.832486Z",
            "url": "https://files.pythonhosted.org/packages/1e/f0/3ef331f76bcf19e8ee85f60df7a5542f4c93ddf1e18533e534afba52c305/gt_extras-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-09 13:43:29",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gt-extras"
}
        
Elapsed time: 2.06151s