Generate Typst Tables from DataFrames.
Project description
typ-tables
Inspired by great_tables, a way to turn DataFrames into Typst tables.
Tables that look like
Created using the following Python script:
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 = table.to_typst()
Which gives you the following typst snippet:
#table(
columns: 3,
column-gutter: (),
row-gutter: (),
stroke: none,
align: (auto, auto, auto),
inset: 0% + 5pt,
table.header(table.cell(
stroke: (bottom: 1.2pt),
[string],
), table.cell(
stroke: (bottom: 1.2pt),
[int],
), table.cell(
stroke: (bottom: 1.2pt),
[float],
),),
table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[a],
), table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[10],
), table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[1e-06],
),
table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[b],
), table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[10000],
), table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[0.1368753],
),
table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[c],
), table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[1000000],
), table.cell(
colspan: 1,
stroke: (bottom: 0.6pt),
[163985.8374],
),
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
typ_tables-0.1.1.tar.gz
(65.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typ_tables-0.1.1.tar.gz.
File metadata
- Download URL: typ_tables-0.1.1.tar.gz
- Upload date:
- Size: 65.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
286908fe9524f91c5b94e59ffe9453c456dd56a0d1a8e156f1266980bd368817
|
|
| MD5 |
ebdfcea914250eb8a54b88a7cbc08803
|
|
| BLAKE2b-256 |
920ed7a1936bdd04a39ed9713570986219fdfdffcabd3ef59af0f34003a263c2
|
File details
Details for the file typ_tables-0.1.1-py3-none-any.whl.
File metadata
- Download URL: typ_tables-0.1.1-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f5d9e4d411adb07fd51cca6b96c05909a6ad9f7527abb5f4e70faa36627384
|
|
| MD5 |
182334aea05b04eee252e640ca545ba8
|
|
| BLAKE2b-256 |
1a8b8db0eb1da24ad795593a3c125fbca5b3360a849064139e36021a58bd71f7
|