django-xrechnung
Create validated XRechnung XML and printable PDF invoices in Django.
Bring invoicing into your existing Django project: prepare drafts in admin or Python, review calculated totals, then finalize and download both documents. The app runs the official KoSIT validator locally and renders PDFs with WeasyPrint. XML, PDF, and the validation report are stored together when finalization succeeds.
What it does
- Invoices, credit notes, and corrections: generate XRechnung 3.0.2 documents in UBL 2.1 or CII, including credit notes and corrected invoices linked to their originals.
- Discounts and surcharges: put any number of allowances and charges on a line, with an optional base amount and percentage, carried through to XML and PDF.
- Flexible VAT: combine German 7% and 19% VAT, exempt lines, and reverse charge with separate tax breakdowns, exemption reasons, and consistent decimal rounding.
- Printable PDFs: produce German invoice layouts with customizable templates, wrapping descriptions, repeated table headers, and page numbers.
- Factur-X output: generate PDF/A-3b invoices with embedded CII using WeasyPrint, validated by veraPDF and the pinned XML rules before issuance.
- Less repeated data entry: reuse seller, contact, and payment defaults for new drafts without changing existing invoices.
- Controlled issuance: enforce ownership and Django permissions, validate before issuing, and preserve finalized documents against edits through the app.
- Django integration: use the supplied admin, review pages, JSON read endpoints, document downloads, and Python services in your own workflows.
- Incoming invoice review: receive immutable originals through Python, a
management command, or admin upload;
deduplicate within owned inboxes, retain validation evidence, and retry failures.
Validate UBL/CII XRechnung and Factur-X XML, including XML extracted from PDFs
with the optional
inboundextra. Review parsed parties, lines and totals, reconciliation mismatches, and unsupported fields without changing originals.
Invoice validation and PDF rendering run on your application host. Invoice data is not uploaded to an external validation service.
Project status
Beta, version 0.3.0. The draft-to-document workflow is implemented, including credit notes and corrections. Automated tests exercise real KoSIT acceptance and rejection, PDF output, permissions, calculations, migrations, and installation from a built wheel.
The current outgoing invoice scope covers German sellers and buyers, EUR, and email electronic addresses. VAT covers standard rates, exemption, reverse charge, zero rating, intra-community supply and export. Payment can be a SEPA transfer to a German IBAN, a SEPA direct debit, or a card. Lines carry discounts and surcharges, and an invoice can carry prepaid and rounding amounts, an instalment schedule, order and contract references, a delivery address, and supporting documents. See the supported invoice scenarios for exact limits.
Document-level allowances and charges, additional countries and currencies, and transmission integrations are not yet supported. Settlement tracking and cumulative credit limits remain outside the app. PDFs can be separate printable documents or Factur-X EN 16931 hybrids with embedded CII and mandatory runtime PDF/A-3b checks.
Get started
python -m pip install django-xrechnung
Optional extras: [cii] for CII output, [hybrid] for Factur-X PDF/A-3b,
[inbound] for receiving documents, [filer] to file stored documents in a
django-filer media library. The development version lives on
Codeberg.
Follow the first-invoice tutorial to install into a Django project and generate your first XML and PDF. The installation guide covers Java and WeasyPrint's system dependencies.
Documentation
The documentation is organized around tutorials, how-to guides, reference, and explanation:
- Configure seller defaults, manage permissions, and customize PDFs.
- Use VAT exemptions and reverse charge.
- Create credit notes and corrected invoices.
- Look up configuration, Python services, and HTTP endpoints.
- Understand finalization and VAT calculations.
- Choose CII or Factur-X PDF output.
- Receive and review documents.
For repository development, see contributing.
See the runnable example, changelog, and compatibility and release policy.
License
BSD 3-Clause. KoSIT, WeasyPrint, and system fonts retain their upstream licenses.
Metadata
Release files for django-xrechnung 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_xrechnung-0.3.0.tar.gz | 358.8 kB | Without provenance | Details for django_xrechnung-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_xrechnung-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for django_xrechnung-0.3.0-py3-none-any.whl |
Total release size: 552.7 kB
Release files / django_xrechnung-0.3.0.tar.gz
| Download URL | django_xrechnung-0.3.0.tar.gz |
|---|---|
| Size | 358.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cab8ae093b675859a9de78b53db4acd793898db5f435f89e53ef53c56499ac85
|
|
BLAKE2b-256 checksum How to use checksums |
4014babef1d11d7e7a496605417c08ae71dcecfe71ad96b75036b4ad4ce22667
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / django_xrechnung-0.3.0-py3-none-any.whl
| Download URL | django_xrechnung-0.3.0-py3-none-any.whl |
|---|---|
| Size | 193.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce0a570909bc9c4c3f2a75aea1284e90ffc13d1ac082852180c4949291e27246
|
|
BLAKE2b-256 checksum How to use checksums |
bcf9b4d7e0cb0fc95fd18c72436e983028cbe23ab79fec011893a4efa0240c16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for django-xrechnung 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.