Skip to main content

facturization

Generate high-quality PDF invoices from a YAML specification.

Background

I needed an invoice generator for my business with high quality typesetting, but I did not like any of the LaTeX templates I could find, and I wanted full control and greater flexibility compared to the projects I had seen. And so here we are.

Requirements

  • A TeX distribution providing pdflatex (e.g. TeX Live) with a few common packages: geometry, ragged2e, booktabs, tabularx, enumitem, hyperref, and babel. These ship with a full TeX Live install.

Installation

Run it directly with uv:

uv run facturization path/to/input.yml --output-dir out/

Or install it as a standalone command-line tool:

uv tool install facturization

Pip is also supported:

pip install facturization

Usage

facturization path/to/input.yml

The only mandatory argument is the path to the input YAML file. --output-dir (-o) defaults to the current directory. For an input named foo.yml the tool writes foo.tex and foo.pdf (alongside pdflatex's .aux/.log) into the output folder.

Example

Try out the example from the repo:

uv run facturization example/details.yml --output-dir example

This renders example/details.yml to example/details.pdf:

Example invoice

Input schema

Top-level keys

Key Required Description
invoice_number yes Invoice identifier, shown in the header.
issue_date yes Date of issue. A YAML date is formatted like May 4, 2026.
due_date no Payment due date, formatted the same way.
from yes The sender party (see Party).
to yes The recipient party (see Party).
service yes The invoice line items (see Service).
currency yes Currency code shown next to the totals, e.g. EUR.
separator yes Decimal separator for amounts: dot or comma.
payment no Ordered mapping of label → value with payment instructions, rendered as a labelled list at the bottom.
reverse_charge_note no Footnote text used when any line sets reverse_charge. Default: VAT to be paid on a reverse charge basis.
closingnote no Free text printed at the very bottom; blank lines start new paragraphs.
lang no babel language for hyphenation and date/typography conventions, e.g. english.
fontsize no Base font size: 10pt (default), 11pt, or 12pt.
geometry no LaTeX geometry options for page size and margins. Default: a4paper, margin=18mm.

Party

Used for both from and to.

Key Required Description
address yes List of lines (name, street, city, country, …), printed as given.
email no Shown as e-mail.
phone no Shown as Phone.
vat_identification_number no Shown as VAT ID.
company_registration_number no Shown as Corp. reg. no.
tax_code no Shown as Tax code.

Service

Each entry in the service list is one line item.

Key Required Description
description yes Line description.
unit_price yes Price per unit.
quantity no Quantity, default 1.
vat no VAT rate in percent, default 0.
reverse_charge no If true, marks the line with a footnote and enables the shared reverse-charge note.
details no List of sub-bullets shown under the description.

Development

Linting and type checking are handled by Ruff and ty, configured in pyproject.toml. Both are part of the dev dependency group, so uv sync installs them.

# Lint
uv run ruff check .

# Verify formatting (no changes written)
uv run ruff format --check .

# Apply auto-fixes and reformat
uv run ruff check --fix .
uv run ruff format .

# Type check (strict mode, all rules as errors)
uv run ty check .

Credits

Inspired by mrzool/invoice-boilerplate. This project takes the same idea of invoice typesetting from a plain data file, but replaces the heavy pandoc dependency with a small uv + Python + Jinja2 pipeline that renders a LaTeX template and compiles it with pdflatex.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facturization-0.1.1.tar.gz (131.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

facturization-0.1.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file facturization-0.1.1.tar.gz.

File metadata

  • Download URL: facturization-0.1.1.tar.gz
  • Upload date:
  • Size: 131.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for facturization-0.1.1.tar.gz
Algorithm Hash digest
SHA256 af65ea9d835cf1da193220c5741cb173e6760b632e81a502b19c2324f6845aa5
MD5 f2ade3be2d829c77bb8fe1e3429fc6a6
BLAKE2b-256 fcde99433b39286af33bfea46ac793b838089ee33f78b641910da013ccead805

See more details on using hashes here.

Provenance

The following attestation bundles were made for facturization-0.1.1.tar.gz:

Publisher: continuous_integration.yaml on m-pilia/facturization

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file facturization-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: facturization-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for facturization-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8cf180ba518b6869a2be050ab07ec48fc7a2d632f85b88980eabaaa52d3131f5
MD5 9fc52b21a505c2a5663c17d47b9c3260
BLAKE2b-256 39159d848e42286ed11beda3340d817e1ccc8f14a2876dc690fe0344ce1be315

See more details on using hashes here.

Provenance

The following attestation bundles were made for facturization-0.1.1-py3-none-any.whl:

Publisher: continuous_integration.yaml on m-pilia/facturization

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page