Skip to main content

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

Release files for onnpdf 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onnpdf 0.0.3
File Size Uploaded
onnpdf-0.0.3.tar.gz 1.9 kB Details

Release files / onnpdf-0.0.3.tar.gz

Download URL onnpdf-0.0.3.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
96f381f03a9849047dd82d481a512b4c71bd1bc5acb538d27bf9bd10375366ef
BLAKE2b-256 checksum
How to use checksums
18e502fe04636e081415eb59cce383a5bac350299bb11c2e5a4ea7bf96a68664
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page