Registry / data / py3o-template

py3o-template

JSON →
library0.10.0pypypi✓ verified 86d ago

An easy solution to design reports using LibreOffice templates (ODT/ODS) and Python. Current version 0.10.0, with releases approximately yearly.

pip install py3o-template
INSTALL
IMPORT
SIG · PY3O-TEMPLATE
P
py3o-template
datapythonv0.10.0
Install
3.7s avg
Import
383ms
Disk
87MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.396s · 85.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.370s · 86MB
87MB installed
● package 87MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Template
from py3o.template import Template
Direct import of the main template class.

Basic usage: load a LibreOffice template, set variables, render.

from py3o.template import Template # Load an ODT template file t = Template(template_path='my_template.odt', out_path='my_output.odt') # Set data my_data = {'name': 'John Doe', 'age': 30} t.set(my_data) # Render the output t.render()
Debug
Known issues
gotchaTemplate files must be ODT format, not OTT (template files). Py3o-template does not handle OTT files.
fix
Use .odt files as templates. Save .ott as .odt first.
affects: all
gotchaVariable substitution syntax conflicts: Jinja2-like syntax may conflict with LibreOffice's own field syntax. Use the correct py3o syntax (e.g., ${variable} in text, or py3o directives).
fix
Use the py3o documentation for proper placeholder syntax; ensure no conflicts.
affects: < 0.10
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'py3o'
Package not installed or environment mismatch.
fix
Run 'pip install py3o-template' to install the package.
AttributeError: 'Template' object has no attribute 'set'
Incorrect version usage. In older versions, the method was named 'set' but in newer it might be 'render' or 'process'. Or wrong API.
fix
Check documentation for the correct method. For 0.10, use 'set' but ensure you have the latest version.
Upgrade
Version history
0.10.0latest on PyPI · released Mar 15, 2019
Audit
Dependencies
lxmlrequiredXML/ODF parsing
py3o-commonrequiredCommon utilities for py3o ecosystem
Agent activity
11 hits · last 30 days
node
10
Resources
py3o-template — pip install py3o-template · libregistry