Skip to main content

No project description provided

Project description

python-odt-template

PyPI - Version PyPI - Python Version


[!IMPORTANT] This package currently contains minimal features and is a work-in-progress

Table of Contents

Installation

pip install python-odt-template

Usage

from python_odt_template import ODTTemplate
from python_odt_template.jinja import enable_markdown
from python_odt_template.jinja import get_odt_renderer
from python_odt_template.libreoffice import convert_to_pdf

odt_renderer = get_odt_renderer(media_path="inputs")

with ODTTemplate("inputs/simple_template.odt") as template, enable_markdown(template.get_markdown_filter()):
    odt_renderer.render(
        template,
        context={"document": document, "countries": countries},
    )
    template.pack("simple_template_rendered.odt")
    convert_to_pdf("simple_template_rendered.odt", "outputs")

Alternatives

Credits

Thanks to secretary for the enormous amount of integration work on Jinja2 and ODT.

License

python-odt-template is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_odt_template-0.1.0.tar.gz (199.9 kB view details)

Uploaded Source

Built Distribution

python_odt_template-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file python_odt_template-0.1.0.tar.gz.

File metadata

  • Download URL: python_odt_template-0.1.0.tar.gz
  • Upload date:
  • Size: 199.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for python_odt_template-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cf755e863866bec1c7b9160a22ae75a09eb377a64aed3528ed5a97e6b675d2c3
MD5 b6cab4cf93f0723e1de8ed4356828b6c
BLAKE2b-256 a034761a1495f2f527f9624bc3c497004729e6ca112c4e319d4e647822da3b38

See more details on using hashes here.

File details

Details for the file python_odt_template-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_odt_template-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00dd2a3c55f214bed1b4098127df0aaf7165ea37429e8a8dfbcf075b4bf9d3d0
MD5 289d31196c55956083392825e43f68fd
BLAKE2b-256 2b33aa9b3324d4b5d169e458ad97513f49071c334852c6655e7e94f84b3960c7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page