py3o.template
An easy solution to design reports using LibreOffice
What it is and what it does
py3o.template is a Python library that takes LibreOffice or OpenOffice document templates (ODT for text, ODS for spreadsheets) and merges them with data dictionaries to produce formatted output documents. It works without requiring LibreOffice or OpenOffice to be installed on the machine running the code—only the template engine itself is needed. The library uses genshi for template expression parsing and babel for date and currency formatting, allowing you to embed dynamic content, loops, conditionals, and formatted values directly into your templates.
The typical workflow is: create a template document in LibreOffice, mark data insertion points with special syntax, then call Template.render() with your data dictionary. For PDF or other output formats beyond ODF, you would need a separate renderserver instance. The package supports image injection, multi-line text, and locale-aware number and date formatting.
Use it for:
- Generate invoices or receipts by merging customer and transaction data into pre-designed ODT templates
- Create spreadsheet reports (ODS) with dynamic data rows, formulas, and formatted currency/date values
- Produce bulk personalized documents by iterating over a list of records and rendering each
- Format dates and currency amounts according to locale-specific rules without manual string manipulation
- Build a document generation service that accepts data and returns ODT/ODS files
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Merges data into LibreOffice/OpenOffice templates (ODT, ODS) to generate formatted documents without requiring LibreOffice installed.
No. The package is abandoned (last release 2019-03-15) and receives no maintenance or security updates. While it has low install friction and permissive licensing, the lack of active development makes it a poor choice for new projects. Consider maintained alternatives if you need LibreOffice-based templating.
Install
py3o-template on PyPI
pip
pip install py3o-templateuv
uv add py3o-templatepoetry
poetry add py3o-templateInstalling py3o.template
Before you install
Low install friction with a pure-Python wheel, but the package has been abandoned since 2019-03-15 with no active maintenance or security updates.
License in practice
MIT License permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.
Quickstart
from py3o.template import Template
t = Template('template.odt', 'output.odt')
t.set_image_path('logo', 'images/logo.png')
data = {'items': [{'name': 'Item1', 'amount': 100}]}
t.render(data)
Requires a LibreOffice or OpenOffice template file (.odt or .ods) to exist as input; for PDF output, a separate renderserver instance is needed.
Verify before relying
- Whether the package works reliably with modern Python versions beyond 3.5, given its abandoned status
- Compatibility with recent LibreOffice/OpenOffice versions and their ODF format changes
- Whether all seven runtime dependencies remain actively maintained and compatible
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — Pillow, babel, genshi, lxml, pyjon.utils, setuptools, six |
| Maintenance | abandoned — 2,709 days since the last release |
| First released | |
| Downloads | 76,878/month — #14,584 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py3o.template-0.10.0-py3-none-any.whl
Keywords: LibreOffice, OpenOffice, templating, PDF
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ezodfezodf creates, opens, and modifies OpenDocument…
permissive · top 15,000 on PyPI
odfdoodfdo is a Python library for creating,…
permissive · top 15,000 on PyPI
pyexcel-ezodfCreate, open, and modify OpenDocument Format…
permissive · top 15,000 on PyPI
unoserverUnoserver runs LibreOffice as a persistent…
permissive · top 15,000 on PyPI
TempitaTempita is a lightweight templating engine that…
permissive · top 15,000 on PyPI
sphinxcontrib.datatemplatesA Sphinx extension that renders…
permissive · top 15,000 on PyPI
DocumentTemplateDocumentTemplate implements the Document…
unclear · top 15,000 on PyPI
antiwordWraps LibreOffice's text conversion to convert…
permissive · top 15,000 on PyPI
pyexcel-ods3Reads, manipulates, and writes data in ODS…
permissive · top 15,000 on PyPI
django-templated-mailSends Django emails using template files…
permissive · top 15,000 on PyPI