Metadata-Version: 2.4
Name: typ-tables
Version: 0.2.0
Summary: Generate Typst Tables from DataFrames.
Keywords: tables,Typst
Author: Benjamin Askew-Gale
License-Expression: MIT
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Visualization
Project-URL: homepage, https://github.com/BenGale93/typ-tables
Project-URL: documentation, https://bengale93.github.io/typ-tables/
Requires-Python: >=3.11
Requires-Dist: narwhals>=2.7.0
Description-Content-Type: text/markdown

# typ-tables

Inspired by great-tables, a way to turn DataFrames into Typst tables.

To install, run `uv add typ-tables`

Tables that look like

![rendered table](https://bengale93.github.io/typ-tables/images/readme_snippet.png)

Created using the following Python script:

```python
import polars as pl
from typ_tables import TypTable

df = pl.DataFrame(
    {
        "string": ["a", "b", "c"],
        "int": [10, 10000, 1000000],
        "float": [0.000001, 0.1368753, 163985.8374],
    }
)

table = TypTable(df)
result: str = table.to_typst()
```

To include the table in your Typst report you can write the resulting Typst
string to a file and include it.

```typst
#include "table.typ"
```

## Documentation

For more, check out the
[documentation](https://bengale93.github.io/typ-tables/changelog/). The
[great_tables](https://posit-dev.github.io/great-tables/articles/intro.html)
documentation is also useful as many of the examples work in `typ-tables`.
