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.

Files for onnpdf, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size onnpdf-0.0.3.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page