Skip to main content

pdfbaker

PyPI version Python Downloads sigstore tests codecov OSSF Scorecard pip-audit bandit Last commit License

Create PDF documents from YAML-configured SVG templates.

  • Separation of design and content: Design your layout visually in SVG while managing content and configuration in YAML.
  • Instant templating: Turn any existing SVG into a configurable template with a single command.

Installation

pdfbaker is available on PyPI and can be installed using pipx:

pipx install pdfbaker

If you don't have pipx yet, install it first:

sudo apt install pipx
pipx ensurepath

Windows Requirements

If you are using Windows, GTK needs to be installed: GTK for Windows Runtime Environment Installer

  • Choose Install GTK+ libraries
  • Tick to setup path (otherwise add the install DLL folder manually)
  • Choose your installation location
  • Complete the installation

Optional Dependencies

  • For SVG to PDF conversion, CairoSVG is used by default. If you need Inkscape instead, install it:

    sudo apt install inkscape
    
  • For PDF compression, install Ghostscript:

    sudo apt install ghostscript
    
  • If your templates embed particular fonts, they need to be installed. For example for Roboto fonts:

    sudo apt install fonts-roboto
    

Quickstart: Create templated PDF from an SVG

The fastest way to get started is with the --create-from option:

  1. Design your document in an SVG editor or convert to SVG.

  2. Run pdfbaker with --create-from to scaffold a new project and generate your first PDF:

    pdfbaker --create-from mydesign.svg myproject/myproject.yaml
    

    This will create a directory structure like:

    myproject
    ├── myproject.yaml
    └── mydesign
        ├── config.yaml
        ├── pages
        │   └── main.yaml
        └── templates
            └── main.svg.j2
    

    and produce your PDF in myproject/dist/mydesign/mydesign.pdf.

  3. Edit the template and YAML files to customize your content and variables. This directory structure is just a starting point. Add more documents and customize as needed.

  4. For future builds, just run:

    pdfbaker myproject/myproject.yaml
    

    to regenerate your PDFs.

Documentation

Examples

For working examples, see the examples directory:

Create all PDFs with:

pdfbaker examples/examples.yaml

Development

All source code is on GitHub.

This project uses uv for dependency management. The uv.lock file ensures reproducible builds.

Create and activate the virtual environment:

uv venv
source .venv/bin/activate

Install development dependencies:

uv sync --dev

Tests

Run tests:

pytest

View test coverage:

pytest --cov=pdfbaker --cov-report=term-missing

Pre-commit hook

If you want to commit changes, install pre-commit (maybe using uv) and run

pre-commit install

This ensures the same checks run locally as in GitHub CI.

Metadata

Release files for pdfbaker 0.11.4

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

Source distribution (sdist)

Source distribution for pdfbaker 0.11.4
File Size Uploaded
pdfbaker-0.11.4.tar.gz 175.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pdfbaker 0.11.4
File Interpreter ABI Platform
pdfbaker-0.11.4-py3-none-any.whl Python 3 none any Details

Total release size: 205.8 kB

Release files / pdfbaker-0.11.4.tar.gz

Download URL pdfbaker-0.11.4.tar.gz
Size 175.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a54307bacdf89c80d70ba5f57208aecb8a55e611f9a90c327298f5cff8301951
BLAKE2b-256 checksum
How to use checksums
6746215af31ef2b7d0702d42ee7d918647a815839b584dd369bf4affb3f17544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 1, 2026.

Transparency log

Release files / pdfbaker-0.11.4-py3-none-any.whl

Download URL pdfbaker-0.11.4-py3-none-any.whl
Size 30.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2639b24520453213ef92a3deee45d998cb481a5a76e047c3b8a12b194d5df279
BLAKE2b-256 checksum
How to use checksums
ff96809cafb27aeb1b4aa9d432b82c1c6a0c247629d317c6042a950b5049fb30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.11.4 This release

2 release files

0.11.3

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.0

2 release files

0.8.9

2 release files

0.8.8

2 release files

0.8.7

2 release files

0.8.6

2 release files

0.8.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

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