pdfbaker

SVG + YAML = PDF

https://github.com/pythonnz/pdfbaker

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

SVG + YAML = PDF

Basic Info
  • Host: GitHub
  • Owner: pythonnz
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 665 KB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 2
  • Open Issues: 2
  • Releases: 19
Created 11 months ago · Last pushed 9 months ago
Metadata Files
Readme Changelog License Citation

README.md

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:

bash pipx install pdfbaker

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

bash 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:

bash sudo apt install inkscape

bash sudo apt install ghostscript

  • If your templates embed particular fonts, they need to be installed. For example for Roboto fonts: bash 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:

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

This will create a directory structure like:

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

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

  1. 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.

  2. For future builds, just run:

bash pdfbaker myproject/myproject.yaml

to regenerate your PDFs.

Documentation

Examples

For working examples, see the examples directory:

Create all PDFs with:

bash 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:

bash uv venv source .venv/bin/activate

Install development dependencies:

bash uv sync --dev

Tests

Run tests:

bash pytest

View test coverage:

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

Pre-commit hook

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

bash pre-commit install

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

Owner

  • Name: Python New Zealand
  • Login: pythonnz
  • Kind: organization

Python New Zealand

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use pdfbaker in your work, please cite it using the following metadata."
title: "pdfbaker"
version: 0.11.0
date-released: 2025-05-23
repository-code: "https://github.com/pythonnz/pdfbaker"
license: "MIT"
authors:
  - family-names: Adair
    given-names: Danny
    orcid: "https://orcid.org/0009-0004-8327-955X"
keywords:
  - PDF
  - SVG
  - YAML
  - CLI
  - Python

GitHub Events

Total
  • Create event: 22
  • Release event: 18
  • Issues event: 41
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 48
  • Push event: 211
  • Public event: 1
  • Pull request review event: 1
  • Pull request event: 8
  • Fork event: 2
Last Year
  • Create event: 22
  • Release event: 18
  • Issues event: 41
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 48
  • Push event: 211
  • Public event: 1
  • Pull request review event: 1
  • Pull request event: 8
  • Fork event: 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 30
  • Total pull requests: 6
  • Average time to close issues: 7 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 1.4
  • Average comments per pull request: 0.67
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 30
  • Pull requests: 6
  • Average time to close issues: 7 days
  • Average time to close pull requests: 1 day
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 1.4
  • Average comments per pull request: 0.67
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • dannyadair (29)
  • ben05allen (1)
Pull Request Authors
  • dannyadair (3)
  • ben05allen (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 84 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 33
  • Total maintainers: 1
pypi.org: pdfbaker

SVG Jinja templates + YAML config = PDF documents

  • Versions: 33
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 84 Last month
Rankings
Dependent packages count: 9.4%
Average: 31.0%
Dependent repos count: 52.7%
Maintainers (1)
Last synced: 6 months ago