Caxton is a typed, declarative Python library for building spreadsheet documents from application data and rendering them to XLSX. Users define the document structure and semantics; Caxton handles layout, compilation, and backend-specific output.
Warning
Caxton is pre-alpha and is not ready for production use. The public DSL may
change until 1.0.0.
๐ Documentation
๐ Changelog
from caxton import render, sheet, spreadsheet, table, text, write
rows = [{"name": "Ada Lovelace"}, {"name": "Grace Hopper"}]
report = spreadsheet(
sheet(
"People",
table(
source=rows,
columns=(text(source="name", title="Name"),),
),
),
)
result = render(report)
write(report, "people.xlsx")More examples are available in the example projects.
The project is licensed under the MIT License.
Caxton requires Python 3.10 or newer. Install it with pip:
pip install caxtonNo additional setup is required