Peppol-Compatible E-Invoicing
A free, open-source Python library for generating structured e-invoices with matching human-readable PDFs.
peppol-invoicing — MIT licensed
Install directly from the repository using pip:
pip install git+https://github.com/jtbr/peppol-invoicing
Run on your own machine.
View on GitHub
Why this exists
From January 2026, Belgian Business to Business (B2B) invoices must be structured e-invoices conforming to the
EN16931
European standard, ideally delivered via the PEPPOL network. Commercial platforms
charge ongoing subscription fees for this. This library is a free alternative: generate
both the machine-readable XML e-invoice and a matching human-readable PDF from a single script.
It is primarily designed for Belgian freelancers and small businesses, but should work for any EU seller.
Note that this tool only creates the invoices. You'll still need to be registered somewhere to send
and receive them over Peppol (this may be your accounting software or a dedicated Peppol access-point;
some options are free or come with no added cost).
What it produces
For each invoice, the library can generate:
- A DOCX and PDF human-readable invoice from a completely customizable Word template
- An EN16931 / PEPPOL BIS 3.0 compliant XML e-invoice, with the PDF optionally embedded for a single self-contained file
Features
EN16931 / PEPPOL BIS 3.0
Compliant XML e-invoice generation, validated against the UBL 2.1 schema
VAT inference
Domestic (standard rated), intra-EU (reverse charge), or non-EU (out of scope) — determined from buyer/seller countries
Human-readable invoices
DOCX/PDF from fully customizable Word templates — usable standalone, even outside the EU
PDF embedding
The PDF invoice can be embedded into the XML for a single self-contained file
Payment means
SEPA credit transfer and ACH/wire transfer supported
Flexible line items
Hourly, lump-sum, unit-based, or per-period items; multi-currency support
How to use it
- Clone the repository and run
pip install .
- For each client, copy the example_invoice script and fill in your seller details, buyer details, and contract data.
- Download the sample Word template and customize it for your own branding.
- Run your script to produce an invoice. For example, run monthly to produce each month's invoice for the client. The invoice number is determined automatically from existing invoices.
LibreOffice must be installed for DOCX-to-PDF conversion.
The library detects it automatically on Linux, macOS, and Windows.
Validation
The library validates generated invoices against the UBL 2.1 schema automatically.
For full EN16931 business rule and PEPPOL compliance validation, use one of these free online validators:
B2B invoicing only. VAT treatment is inferred from buyer and seller country codes, assuming a business-to-business transaction. Verify the inferred VAT treatment with your tax advisor before issuing real invoices.
How much does it cost?
Nothing, it's free and open-source under the MIT license. We built it for our own use and
decided to share it. Hope it proves useful.
If this saves you time, effort, or money, you can always help
. It's certainly appreciated!
Something not working? Suggested improvement? Open an issue on
GitHub, submit a Pull Request, or
send a note to
[email protected].
Disclaimer. This library is provided for informational and technical purposes only
and DOES NOT CONSTITUTE FINANCIAL, TAX, OR LEGAL ADVICE. VAT treatment is inferred from country codes
and may not be correct for your specific situation. YOU ARE SOLELY RESPONSIBLE for verifying that
invoices comply with applicable tax laws and regulations before issuing them. The authors are not
accountants or tax advisors. The authors make no warranty and accept no liability for errors,
omissions, or any loss arising from use of this software.
We respect your privacy and do not use cookies or collect personal information.