Registry / data / great-tables

great-tables

JSON →
library0.22.0pypypi✓ verified 84d ago

Great Tables is a Python library designed to easily generate information-rich, publication-quality display tables from Pandas or Polars DataFrames. It allows for extensive customization of table components like headers, footers, row labels (stubs), spanner labels, and offers various formatting options for cell values, including nanoplots. The current version is 0.21.0, released on March 3, 2026, and it sees active development with regular updates.

pip install great-tables
INSTALL
IMPORT
SIG · GREAT-TABLES
G
great-tables
datapythonv0.22.0
Install
3.0s avg
Import
703ms
Disk
68MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.22.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.746s · 70MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.0s · import 0.660s · 71MB
68MB installed
● package 68MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GT
from great_tables import GT
data
from great_tables.data import sp500
Example datasets are available under `great_tables.data`.

This quickstart demonstrates creating a table using the `GT` class from a Pandas DataFrame (specifically, a built-in dataset). It includes adding a table header and formatting currency and date columns using method chaining. The resulting table automatically renders in notebook environments; for console use, `show()` opens it in a browser.

import pandas as pd from great_tables import GT from great_tables.data import sp500 # Filter sp500 using Pandas for a specific date range start_date = "2010-06-07" end_date = "2010-06-14" sp500_mini = sp500[(sp500["date"] >= start_date) & (sp500["date"] <= end_date)] # Create a display table, add a header, and format columns gt_table = ( GT(sp500_mini) .tab_header(title="S&P 500", subtitle=f"{start_date} to {end_date}") .fmt_currency(columns=["open", "high", "low", "close"]) .fmt_date(columns="date", date_style="wd_m_day_year") ) # In a notebook environment, `gt_table` will render automatically. # In a console, use `gt_table.show()` to open in a browser. # For demonstration purposes, we'll indicate successful creation. print("Great Table created successfully (output not shown in console).")
Debug
Known issues
gotchaTables created with Great Tables do not print to the console by default. In a standard Python console, you must explicitly call the `.show()` method on the GT object to open the HTML table in your default web browser.
fix
Call `.show()` on your GT object (e.g., `my_table.show()`) when working outside of a notebook or Quarto environment.
affects: All versions
breakingThe `polars.DataFrame.style` property for styling Polars DataFrames is currently considered unstable and may change in future versions. Directly passing a Polars DataFrame to `GT()` is stable.
fix
Prioritize passing Polars DataFrames directly to the `GT()` constructor rather than relying on the `DataFrame.style` property for stability.
affects: Potentially all current and future versions (as of v0.21.0)
breakingVersion 0.15.0 introduced breaking changes related to ensuring unique HTML ID attributes and moving the `css-inline` package to an extra group. While not directly in 0.21.0, this indicates a history of HTML-rendering related breaking changes.
fix
Review the changelog for specific versions when upgrading, especially if custom HTML output or styling is being used, and adapt code for HTML ID uniqueness or CSS handling.
affects: v0.15.0 and potentially subsequent minor versions if custom HTML/CSS was heavily relied upon.
gotchaThe `GT` object is immutable once created. Applying new options or modifications requires re-creating or chaining methods on the `GT` object.
fix
Always chain methods when applying multiple transformations (e.g., `GT(df).tab_header(...).fmt_currency(...)`) or re-assign the result of a modification to the GT object if performing operations in multiple steps.
affects: All versions
Errors
Common errors & fixes
TypeError: ColumnFactory.__new__() missing 1 required positional argument: 'name'
This error often occurs when an incompatible version of the Polars library is used with great-tables, due to changes in Polars' internal API, specifically regarding the `ColumnFactory` constructor.
fix
Ensure both `great-tables` and `polars` are updated to their latest compatible versions.
`pip install --upgrade great-tables polars`
SessionNotCreatedException: Message: session not created: probably user data directory is already in use
This error arises when the `GT.save()` function attempts to use a Selenium WebDriver (e.g., Chrome, Edge) to take a screenshot, but the browser's user data directory is locked or already in use by another process or a previous, improperly closed session.
fix
Close all active browser instances (especially those managed by Selenium) and try again. If the issue persists, consider specifying an alternative `web_driver` (e.g., 'edge', 'firefox') or configuring a unique temporary `user-data-dir` for the WebDriver.
```python
# Option 1: Try an alternative browser driver
gt_table.save("output.png", web_driver='edge')

# Option 2: For more advanced control (e.g., with Chrome)
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument("--headless") # Run in headless mode
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--user-data-dir=/tmp/great_tables_profile") # Use a unique temporary directory

driver = webdriver.Chrome(options=chrome_options)
gt_table.save("output.png", web_driver=driver)
driver.quit() # Important to quit the driver
```
TypeError: the truth value of a Series is ambiguous
This error occurs when a Polars Series, which can contain multiple values, is implicitly converted to a boolean in a context that expects a single `True` or `False` value, often when `great-tables` or an extension tries to evaluate cell contents in a conditional manner.
fix
Ensure that `great-tables`, `polars`, and any related extensions (like `gt-extras`) are updated to their latest versions, as this can be due to type inconsistencies. If writing custom logic involving Polars Series in boolean contexts, explicitly use methods like `.any()`, `.all()`, or `.item()` to obtain a single boolean value.
`pip install --upgrade great-tables polars gt-extras`
KeyError: 'font_color_row_striping_background_color'
This `KeyError` indicates that `great-tables` is attempting to access a theme or style configuration key related to row striping and font color that is either missing, misspelled, or incompatible with the current version or applied theme.
fix
Update `great-tables` to the latest version to get bug fixes. If the error persists, especially when using `data_color()`, try explicitly setting `autocolor_text=False` within that method as a workaround if text auto-coloring is causing the issue.
```python
pip install --upgrade great-tables

# Example workaround if error occurs with data_color()
gt_table.data_color(
    columns="your_column",
    palette="RdYlGn",
    autocolor_text=False # Disable automatic text coloring
)
```
Upgrade
Version history
0.22.0latest on PyPI · released Jun 12, 2026
Audit
Dependencies
pandasoptionalCommonly used for data input; many examples and datasets are Pandas DataFrames.
polarsoptionalSupported for data input as an alternative to Pandas DataFrames.
Agent activity
4 hits · last 30 days
node
4
Resources