skillfed

py3o.template

An easy solution to design reports using LibreOffice

py3o-template v0.10.0 76.9K downloads/30d#14,584 on PyPI
Permissive license MIT License Abandoned released

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-template

uv

uv add py3o-template

poetry

poetry add py3o-template

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Software Development :: Libraries :: Python Modules

Tags

libreoffice template renderingodt ods document generationopenoffice mail mergepython report templatingodf document data bindingdynamic document generationtemplate-based report creation
document-generationabandoned-package

More Python Modules packages