gridwell
Render one table to HTML, LaTeX, Typst, RTF, SVG, terminal text, Pandoc and Quarto, Word, Excel and PowerPoint. gridwell takes a Great Tables table as it is, or its own IR, a JSON description of a fully formatted table that any tool can write.
gridwell's engine is written in Rust. This is the Python package; an R package built on the same engine takes gt tables. Source, issues and the R package are at github.com/rich-iannone/gridwell. The documentation, with a user guide and the IR's full schema, is at rich-iannone.github.io/gridwell.
Status: alpha. The API may change between releases.
Installation
pip install gridwell
pip install "gridwell[gt]" # with the Great Tables integration
import gridwell needs nothing else; the gt extra adds pandas and Great Tables 1.1.0 or
newer.
Wheels cover Python ≥ 3.10 on Linux (x86_64, aarch64), macOS (Intel, Apple silicon) and Windows (x86_64). Elsewhere, and on free-threaded Python builds, pip builds from the source distribution, which needs a Rust toolchain (≥ 1.85).
Usage
A Great Tables table goes straight in:
from great_tables import GT, exibble
import gridwell
table = gridwell.Table(GT(exibble.head(5), rowname_col="row", groupname_col="group"))
html = table.render_html()
latex = table.render_latex()
table.save("table.docx") # the format comes from the extension
In a notebook a Table shows as HTML; print(table) draws it as text.
Any tool can make a table by writing the IR, as JSON or a dict. Most fields can be left out, taking their defaults:
import gridwell
def text(value):
return {"content": [{"type": "text", "value": value}]}
table = gridwell.Table({
"ir_version": "1.0",
"config": {"table_cols": 2, "header_rows": 1, "body_rows": 2},
"styles": {},
"column_spec": [{"id": "name"}, {"id": "score", "align": "right"}],
"table": {
"thead": {"rows": [{"cells": [text("Name"), text("Score")]}]},
"tbody": [{"rows": [
{"cells": [text("Alice"), text("95")]},
{"cells": [text("Bob"), text("87")]},
]}],
},
})
>>> print(table.render("latex"))
\begin{tabular}{lr}
\toprule
Name & Score \\
\midrule
Alice & 95 \\
Bob & 87 \\
\bottomrule
\end{tabular}
<BLANKLINE>
>>> print(table)
┌────────────┬────────────┐
│ Name │ Score │
├────────────┼────────────┤
│ Alice │ 95 │
│ Bob │ 87 │
└────────────┴────────────┘
Formats
| Format | Name | Returns |
|---|---|---|
| HTML | html |
str |
| LaTeX | latex |
str |
| Typst | typst |
str |
| RTF | rtf |
str |
| SVG | svg |
str |
| Terminal text | ansi |
str |
| Pandoc AST | pandoc |
str (JSON) |
| Quarto | quarto |
str (JSON) |
| Word | docx |
bytes |
| Excel | xlsx |
bytes |
| PowerPoint | pptx |
bytes |
table.render(name) gives the text formats and table.render_binary(name) the Office
ones. Each format also has a method with its options as keyword arguments, such as
table.render_xlsx(base_styles=False). gridwell.formats() lists the formats with
their options.
SVG, ANSI, Pandoc and Quarto are experimental for now: their output is valid and has every cell, but their styling is best-effort and may change between releases.
License
MIT.
Metadata
Release files for gridwell 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gridwell-0.1.0.tar.gz | 841.1 kB | Without provenance | Details for gridwell-0.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| gridwell-0.1.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for gridwell-0.1.0-cp310-abi3-win_amd64.whl |
| gridwell-0.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for gridwell-0.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| gridwell-0.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for gridwell-0.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| gridwell-0.1.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) | Details for gridwell-0.1.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
Total release size: 12.1 MB
Release files / gridwell-0.1.0.tar.gz
| Download URL | gridwell-0.1.0.tar.gz |
|---|---|
| Size | 841.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0a17aefd36cdd9045f391efa48e6ba172bb6435b317669eaf3bb5276c77392e
|
|
BLAKE2b-256 checksum How to use checksums |
c3328ca89d49ef660d48c0280dd7238c5c9a9f879a357b6f7eb583ec9505f9c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / gridwell-0.1.0-cp310-abi3-win_amd64.whl
| Download URL | gridwell-0.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c3132c5c857bb7ef0927a38ab451a64cf8c0c657634a3af48eaa867c6e2ddf33
|
|
BLAKE2b-256 checksum How to use checksums |
4998cf227a10107bfd204db66d3edced75e20541aee549bbbb0ddfc82dc3a034
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / gridwell-0.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | gridwell-0.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
be1a106e2ef030643e36c5ae4b6feb0762bab246b5da0b8b093e7aaaf2d5b9bc
|
|
BLAKE2b-256 checksum How to use checksums |
cc0c87deeb185a78ed639f3a37bc89482c913e89ebe7bbcd17e3d099e0fc653a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / gridwell-0.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | gridwell-0.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a45d7b37b232707d4b89199648f0680c593f4fa0945d96987c922dca83e14ae7
|
|
BLAKE2b-256 checksum How to use checksums |
ad5b91d3c0a96b8293fa12fde4a0bbd65ee78e5390e864c8d9d8eb2db7ebb9aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / gridwell-0.1.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | gridwell-0.1.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
55f85aae8a4ae7f75187b4b88487a4e33a663970d366dc7d074ddc4c443a2e3b
|
|
BLAKE2b-256 checksum How to use checksums |
839fca861336cb71988a14134e72e443101d0b85a95e644159fabf02929342ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for gridwell 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.