greater_tables

image1 image2 image3

Greater Tables produces high-quality static display tables — for journal articles, books, formal reports, and printed financial statements. A pandas DataFrame (or CSV, or markdown table) goes in; a clean, typographically sound table comes out in HTML, LaTeX (via TikZ), or plain text. No sparklines, no color, no shading: just your data, rendered cleanly.

from greater_tables import GT
GT(df)

This documentation covers version 6.0, a ground-up rewrite of greater-tables. Between the DataFrame and the page sits a versioned, JSON-serializable table document — the IR. Python owns semantics (dtypes, format inference, multi-index hierarchy, spans, break depths); each renderer owns geometry and style. Nothing in the IR names a width, a rule weight, a font, or a CSS property, so the HTML renderer, the TikZ renderer, the text oracle, and the bundled JavaScript walker all draw the same table — and are conformance tested against each other.

Designed for JupyterLab, Quarto, and scripting: the output format is auto-detected. A notebook or Quarto HTML render gets HTML, a Quarto PDF render gets TikZ, and every bundle also carries text/plain so a table degrades to a readable monospace rendering instead of vanishing — see Notebooks and Quarto. Display tables are small and focused — the end result of your analysis, after selecting rows and columns, ordering, and labeling. Greater Tables gets those raw materials onto the page, cleanly and consistently.

Also included: Fabricator, a flexible test DataFrame generator — specify row count, index and column hierarchies, data types, missing values, and more.

Installation

pip install greater-tables

Requires Python 3.12+. Runtime dependencies are numpy, pandas, pydantic and PyYAML — nothing else. Pin greater-tables<6 anywhere you want to stay on the frozen 5.3 engine; the import name never changes, so from greater_tables import GT works on both.

Source

GitHub. The repo keeps the development codename greatest-tables; the package it publishes is greater-tables. greater_tables 5.x stays pinnable on PyPI forever, with its source and issue archive at mynl/greater_tables_project.

License

MIT.

The Name

Obviously, the name is a play on the great_tables package. I have been maintaining a set of macros called GREATools (generalized, reusable, extensible actuarial tools) in VBA and Python since the late 1990s, and call all my macro packages GREAT. The rewrite was codenamed greatest while it grew up next to its parent; the repo kept the codename, the package did not.

Indices and tables