A lightweight open-source Peppol bookkeeping toolkit for small Belgian companies.
Project description
peppolling
A lightweight, open‑source Python toolkit that helps small Belgian companies work with Peppol for sending, receiving, and processing electronic invoices.
It includes:
- A minimal bookkeeping model (Users, Transactions, Invoices)
- A Peppol BIS Billing 3.0 compliant UBL invoice generator
- Integration with the Peppyrus API for sending and receiving invoices
- Automatic import of received invoices into your bookkeeping
- A simple SQLAlchemy-based storage layer
The goal is to make Peppol accessible for freelancers, small businesses, and developers who want a clean, understandable, and fully open solution without vendor lock-in.
Features
✔ Generate UBL 2.1 EN16931 / Peppol BIS Billing 3.0 invoices
Fully standards-compliant XML generation, including:
- Supplier & buyer party structures
- VAT breakdowns
- Invoice lines
- Payment terms
- Legal monetary totals
- Correct element ordering for Peppol validation
✔ Send invoices via Peppyrus
A simple wrapper around the Peppyrus /message/send endpoint.
✔ Receive invoices from Peppyrus
Fetch messages from the Peppol inbox, decode base64 XML, and parse UBL invoices.
✔ Automatic bookkeeping import
Received invoices are converted into:
- A
Transactionrecord - An
Invoicerecord - Linked supplier and buyer
Userentries
✔ SQLite by default
Works out of the box with:
sqlite:///bookkeeping.db
But you can point it to any SQLAlchemy-compatible database.
Installation
Once published to PyPI:
pip install peppolling
For now, if installing locally:
pip install .
Quick Start
from peppolling import PeppolBookkeeping
bk = PeppolBookkeeping(
peppol_api_key="YOUR_PEPPRUS_API_KEY",
sender_peppol_id="YOUR_PEPPOL_ID"
)
# Receive and import invoices
results = bk.receive_invoices()
for r in results:
print("Imported:", r)
Generating and sending an invoice
supplier = bk.session.query(User).filter_by(company="My Company").first()
buyer = bk.session.query(User).filter_by(company="Customer NV").first()
items = [
{
"name": "Consulting",
"description": "Software development services",
"quantity": 10,
"unit_price": 75,
"vat_pct": 0.21
}
]
xml_bytes = bk.generate_invoice_xml(
supplier=supplier,
buyer=buyer,
items=items,
invoice_id="INV-2025-001",
issue_date=date.today()
)
status, response = bk.send_invoice(xml_bytes)
print(status, response)
Receiving and importing invoices
results = bk.receive_invoices()
for invoice in results:
print(invoice["invoice_id"], invoice["total"])
This automatically:
- Decodes the UBL XML
- Extracts supplier, buyer, totals, VAT
- Creates a
Transaction - Stores an
Invoicerecord
Database Models
The package includes three simple SQLAlchemy models:
UserTransactionInvoice
These can be extended or replaced depending on your needs.
Configuration
You can configure:
- Database URL
- Peppyrus API endpoint
- Peppol sender ID
- Sender company details
Example:
bk = PeppolBookkeeping(
db_url="sqlite:///mybooks.db",
peppol_api_key="xxx",
peppol_endpoint="https://api.test.peppyrus.be/",
sender_peppol_id="0088:123456789",
sender_company="My Company",
sender_vat="BE0123456789",
sender_street="Main Street 1",
sender_city="Brussels",
sender_postal="1000",
sender_country_code="BE"
)
Why this project exists
Many small Belgian companies struggle with Peppol integration.
This project aims to:
- Lower the barrier to entry
- Provide a transparent, open-source alternative
- Offer a simple bookkeeping workflow that can be extended or embedded
- Help freelancers and small businesses stay compliant without expensive software
License
MIT License — free to use, modify, and distribute.
Contributing
Pull requests, issues, and improvements are welcome.
If you build something on top of this, consider sharing it back with the community.
Roadmap
- CLI (peppolling send, peppolling receive)
- Optional web dashboard
- Support for credit notes
- Support for attachments
- SMP lookup helper
- VAT reporting helpers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file peppolling-0.1.0.tar.gz.
File metadata
- Download URL: peppolling-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0a134cc52def3940789272978fbc2a61f07b24caf0420d32769a338025827c7
|
|
| MD5 |
768936f08c2b1cb5bd52b2d621be31a1
|
|
| BLAKE2b-256 |
7dca5540ec0d0f0e9bfa1034e873705cff0504003850d4d06abbd1ed3c0a8336
|
File details
Details for the file peppolling-0.1.0-py3-none-any.whl.
File metadata
- Download URL: peppolling-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e1d8b7862503384925afbcc2101f33a290d18f997a3b519132403026815eace
|
|
| MD5 |
414e61756caa15c8cc692939c18ead0d
|
|
| BLAKE2b-256 |
f287d22494b9598b402fb3d0a2397421082bb9cf2b108a2c4107fa1d6ff8c075
|