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
Stable v1.0.0 will be released when we decide, that no longer want to freely change the public DSL |
|---|
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
Install Caxton with pip:
pip install caxton
No additional setup is required