About tgextodt
tgextodt is a Pluggable application for TurboGears2 that allows the rendering of .odt (openoffice/libreoffice) documents as an output templates.
Installing
tgextodt can be installed both from pypi or from bitbucket:
pip install tgextodt
should just work for most of the users
Plugging tgextodt
In your application config/app_cfg.py import plug, then at the end of the file call plug with tgextodt:
from tgext.pluggable import plug plug(base_config, 'tgextodt')
Usage
To use an odt template you have to declare the type in your controller as below:
@expose('odt:example.templates.about', content_type='application/vnd.oasis.opendocument.text')
def about(self):
response.headerlist.append(('Content-Disposition', 'attachment;filename=filename.odt'))
return dict(hello='Hello World')
obviously in your example application in the folder example/templates you should provide a templated named about.odt in wich you have defined the variable field py3o.document.hello.
To define a variable field in libreoffice you can dig more information on https://help.libreoffice.org/Writer/Variables basically from the menu Insert -> Fields -> Other -> Variables
For more complex features, like for loops and more detailed reporting stuff, you want to read the documentation of the py3o library itself http://py3otemplate.readthedocs.org/
Now you can directly download your output from /about or /about.odt
Metadata
Release files for tgext.odt 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tgext.odt-0.3.tar.gz | 3.0 kB | Without provenance | Details for tgext.odt-0.3.tar.gz |
Release files / tgext.odt-0.3.tar.gz
| Download URL | tgext.odt-0.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2efbf9ff931406c844ab17b0a411748064b649e2a3bc51c6235115beffd0e898
|
|
BLAKE2b-256 checksum How to use checksums |
dac66e5c2359f6a3c19299e7bbd1aed67d3a94b26489309e6f9b379a8e186b57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tgext.odt 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.