Registry / finance / drafthorse

drafthorse

JSON →
library2025.2.0pypypiunverified

Python ZUGFeRD XML implementation for creating and parsing ZUGFeRD invoices. Current version 2025.2.0. Released as a date-based version annually with maintenance updates.

pip install drafthorse
INSTALL
IMPORT
SIG · DRAFTHORSE
D
drafthorse
financepythonv2025.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Invoice
from drafthorse import Invoice
from drafthorse.models.invoice import Invoice

Create a minimal ZUGFeRD invoice and output XML.

from drafthorse.models.invoice import Invoice from drafthorse.writer import XMLWriter invoice = Invoice() # Set required fields... xml_string = XMLWriter(invoice).write() print(xml_string)
Debug
Known issues
breakingThe package versioning scheme changed to date-based versions (e.g., 2025.2.0). There is no semantic versioning guarantee.
fix
Pin to a specific version or use ~=2025.2.0 if you want only patch updates.
affects: all
gotchaAll model fields are mandatory by default. Missing required fields raises a ValueError during write() without clear validation messages.
fix
Use the 'required' parameter when constructing fields or set them all before writing.
affects: all
deprecatedThe old import path 'from drafthorse import Invoice' may still work but is deprecated; use explicit submodule imports.
fix
Import from 'drafthorse.models.invoice' instead.
affects: >=2025.0.0
Upgrade
Version history
2025.2.0latest on PyPI · released Sep 15, 2025
Audit
Dependencies
lxmlrequiredXML parsing and generation
Agent activity
31 hits · last 30 days
node
28
OpenAI (training)
1
Resources
drafthorse — pip install drafthorse · libregistry