Peppol-Compatible E-Invoicing
A free, open-source Python library for generating structured e-invoices with matching human-readable PDFs.
peppol-invoicing — MIT licensed, no subscription
Clone the repository and install with pip. Runs entirely on your own machine.
pip install git+https://github.com/jtbr/peppol-invoicing
View on GitHub
Why this exists
From January 2026, Belgian 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 works 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).
What it produces
For each invoice, the library generates:
- 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 .
- Copy
examples/example_invoice.py 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 each month to produce that month's invoice. 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? / What's the catch?
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.
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 author makes no warranty and accepts no liability for errors,
omissions, or any loss arising from use of this software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
We respect your privacy and do not use cookies or collect personal information.