{"id":5952,"library":"great-tables","title":"Great Tables","description":"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.","status":"active","version":"0.21.0","language":"en","source_language":"en","source_url":"https://github.com/posit-dev/great-tables","tags":["tables","data presentation","pandas","polars","html","jupyter","quarto","data visualization"],"install":[{"cmd":"pip install great-tables","lang":"bash","label":"PyPI"},{"cmd":"conda install -c conda-forge great_tables","lang":"bash","label":"Conda-Forge"}],"dependencies":[{"reason":"Commonly used for data input; many examples and datasets are Pandas DataFrames.","package":"pandas","optional":true},{"reason":"Supported for data input as an alternative to Pandas DataFrames.","package":"polars","optional":true}],"imports":[{"symbol":"GT","correct":"from great_tables import GT"},{"note":"Example datasets are available under `great_tables.data`.","symbol":"data","correct":"from great_tables.data import sp500"}],"quickstart":{"code":"import pandas as pd\nfrom great_tables import GT\nfrom great_tables.data import sp500\n\n# Filter sp500 using Pandas for a specific date range\nstart_date = \"2010-06-07\"\nend_date = \"2010-06-14\"\nsp500_mini = sp500[(sp500[\"date\"] >= start_date) & (sp500[\"date\"] <= end_date)]\n\n# Create a display table, add a header, and format columns\ngt_table = (\n    GT(sp500_mini)\n    .tab_header(title=\"S&P 500\", subtitle=f\"{start_date} to {end_date}\")\n    .fmt_currency(columns=[\"open\", \"high\", \"low\", \"close\"])\n    .fmt_date(columns=\"date\", date_style=\"wd_m_day_year\")\n)\n\n# In a notebook environment, `gt_table` will render automatically.\n# In a console, use `gt_table.show()` to open in a browser.\n# For demonstration purposes, we'll indicate successful creation.\nprint(\"Great Table created successfully (output not shown in console).\")","lang":"python","description":"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."},"warnings":[{"fix":"Call `.show()` on your GT object (e.g., `my_table.show()`) when working outside of a notebook or Quarto environment.","message":"Tables 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Prioritize passing Polars DataFrames directly to the `GT()` constructor rather than relying on the `DataFrame.style` property for stability.","message":"The `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.","severity":"breaking","affected_versions":"Potentially all current and future versions (as of v0.21.0)"},{"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.","message":"Version 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.","severity":"breaking","affected_versions":"v0.15.0 and potentially subsequent minor versions if custom HTML/CSS was heavily relied upon."},{"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.","message":"The `GT` object is immutable once created. Applying new options or modifications requires re-creating or chaining methods on the `GT` object.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}