Declarative Python library for describing and generating documents from application data. Users define the document structure and semantics, while renderers handle output formats and backend-specific details
from caxton import render, sheet, spreadsheet, table, text, write
rows = [{"name": "Ada Lovelace"}, {"name": "Grace Hopper"}]
report = spreadsheet(
sheet(
"People",
table(
rows,
text("name").titled("Name"),
),
),
)
result = render(report)
write(report, "people.xlsx")More examples are available in the example projects
The project is licensed under the MIT
Install Caxton with pip:
pip install caxton
No additional setup is required