Skip to main content

Convenience Python module for creating templated PDF documents

Project description

OzNetNerd PDF

Convenience Python module for creating templated PDF documents using Jinja2 and WeasyPrint.

Installation

pip3 install onnpdf

Usage

Pass a dictionary into onnpdf, and it will:

  1. Perform a "find and replace" operation (as well as other Jinja2 operations defined in your template)
  2. Convert the template into a PDF document

Example dictionary as seen in code snippets:

kv_pairs = {
    'title': 'OzNetNerd.com Demo PDF',
    'author': 'Will Robinson',
    'job_title': 'DevOps Specialist',
    'company': 'OzNetNerd.com',
    'email': 'will@oznetnerd.com',
    'phone': '+61 00 000 000',
    'website': 'https://oznetnerd.com'
}

Example Document

The above produces this PDF document.

Example Use Case

Automate the creation of personalised lab guides for users.

This enables lab admins to easily provide users with unique usernames, passwords, DNS entries, etc.

Contact

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

onnpdf-0.0.3.tar.gz (1.9 kB view details)

Uploaded Source

File details

Details for the file onnpdf-0.0.3.tar.gz.

File metadata

  • Download URL: onnpdf-0.0.3.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.9

File hashes

Hashes for onnpdf-0.0.3.tar.gz
Algorithm Hash digest
SHA256 96f381f03a9849047dd82d481a512b4c71bd1bc5acb538d27bf9bd10375366ef
MD5 1d5812feac4e2ec17c7576490b2652e5
BLAKE2b-256 18e502fe04636e081415eb59cce383a5bac350299bb11c2e5a4ea7bf96a68664

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