Templated-docs
===============================
.. image:: https://badge.fury.io/py/templated-docs.svg
:target: https://pypi.python.org/pypi/templated_docs
.. image:: https://img.shields.io/travis/alexmorozov/templated-docs.svg
:target: https://travis-ci.org/alexmorozov/templated-docs
.. image:: https://readthedocs.org/projects/templated-docs/badge/?version=latest
:target: https://templated-docs.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://requires.io/github/alexmorozov/templated-docs/requirements.svg?branch=master
:target: https://requires.io/github/alexmorozov/templated-docs/requirements?branch=master
:alt: Dependencies
Generate templated documents within Django in any format supported by
LibreOffice: texts, spreadsheets, presentations etc.
* Free software: MIT license
* Documentation: https://templated-docs.readthedocs.io.
Requirements
------------
* Python 2.7 or 3.4+
* Django >= 1.8
* A recent LibreOffice version (>=4.3.0) supporting LibreOfficeKit API.
.. include:: docs/partial/libffi-warning.rst
Example usage
-------------
Create a ``sample.odt`` document (make sure it's in OpenDocument format) and
put it in your Django templates folder. It should look something like this:
.. image:: https://github.com/alexmorozov/templated-docs/raw/master/docs/document-template.png
Then write a view to generate documents from this template:
.. code-block:: python
from templated_docs import fill_template
from templated_docs.http import FileResponse
def get_document(request):
"""
A view to get a document filled with context variables.
"""
context = {'user': request.user} # Just an example
filename = fill_template('sample.odt', context, output_format='pdf')
visible_filename = 'greeting.pdf'
return FileResponse(filename, visible_filename)
Navigate to the url your view is connected to, and you'll see a rendered and converted document:
.. image:: https://github.com/alexmorozov/templated-docs/raw/master/docs/generated-document.png
For more examples, see the ``examples/`` subfolder in the repository. More detailed documentation is available on https://templated-docs.readthedocs.io.
Credits
---------
Templated-docs was written by `Alex Morozov`_.
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
.. _pylokit: https://github.com/xrmx/pylokit
.. _`Alex Morozov`: http://morozov.ca
Metadata
Release files for templated_docs 0.3.1
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 |
|---|---|---|---|---|
| templated_docs-0.3.1.tar.gz | 45.7 kB | Without provenance | Details for templated_docs-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| templated_docs-0.3.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for templated_docs-0.3.1-py2.py3-none-any.whl |
Total release size: 64.1 kB
Release files / templated_docs-0.3.1.tar.gz
| Download URL | templated_docs-0.3.1.tar.gz |
|---|---|
| Size | 45.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd943db61781db2967e36b058cd1d6e0736d8f83c8c80b5acb6bdbe80c72ce02
|
|
BLAKE2b-256 checksum How to use checksums |
9194a290070ea50a1f858016787c10a90c36a33f84b7f882c5bed7f8b61f848c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / templated_docs-0.3.1-py2.py3-none-any.whl
| Download URL | templated_docs-0.3.1-py2.py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ab03ca9f648ae7feaa2751b8177c921bf5dd20646360d02f9cd69d87cb4a1f98
|
|
BLAKE2b-256 checksum How to use checksums |
768e9b9bf0a2a7af9a4145a516067f52816ce711532bde88d81315b50b7dad09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for templated_docs 0.3.1
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.