Skip to main content

Digital-Invoice

Digital-Invoice is a package to write or reader e-invoice (UBL or factur-x format) from JSON data

JSON Format

{
    "bill": {
        "date": "2026-03-15",                             # date in iso-format
        "num": "ABC1234", 
        "origin": "XYZ9876", 
        "detail": [
            {
                "id": "123",
                "reference": "AAA001",
                "designation": "Article sending",
                "price": 12.35,                           # price without VAT
                "quantity": 2.0,
                "vat_rate": 10.0,                         # VAT in percent
                "reduce": 5.0,                            # reduce without VAT
                "total": 19.70,                           # total exclude tax
            }
        ],
        "vat_info": [
            {
                "calculate": 19.70,                       # sum of all detail with this rate
                "basic": 1.97,                            # VAT total for this rate
                "rate": 10.0,
            }
        ],
        "total": {
            "excltax": 19.70,                             # total without VAT
            "incltax": 21.67,                             # total with VAT
            "payed": 10.0,
            "topay": 11.67,
            "tax": 1.97
        },
    },
    "buyer": {
        "name": "L'acheteur de Lyon",
        "legal_ident": "123456789",
        "vat_ident": "FR123456789",
        "postalcode": "69002",
        "address": ["place de Bellecours"],
        "city": "LYON",
        "country_id": "FR",
        "email": "buyer@digital-invoice.net",
        "phone": "+339876543210",
    },
    "seller": {
        "name": "Le vendeur de MARSEILLE",
        "legal_ident": "987654321",
        "vat_ident": "FR987654321",
        "postalcode": "13001",
        "address": ["Vieux port","BP 1234"],
        "city": "MARSEILLE",
        "country_id": "FR",
        "email": "seller@digital-invoice.net",
        "phone": "+331234567890",
    },
    "currency_code": "EUR"
}

Writer

Example:

writer = WriterInvoice()
writer.run(eformat=WriterInvoice.facturX, data=invoice_data)
writer.saveInPDF(pdf_stream)
writer = WriterInvoice()
writer.run(eformat=WriterInvoice.UBL, data=invoice_data)
print(writer.content_xml)

Reader

Example:

reader = ReaderInvoice()
if reader.run(pdf_stream) == ReaderInvoice.facturX:
   print(reader.data)
reader = ReaderInvoice()
if reader.run("UBL.xml") == ReaderInvoice.UBL:
   print(reader.data)

Metadata

Release files for digital-invoice 0.9.6.1792506571

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for digital-invoice 0.9.6.1792506571
File Interpreter ABI Platform Actions
digital_invoice-0.9.6.1792506571-py3-none-any.whl Python 3 none any Details for digital_invoice-0.9.6.1792506571-py3-none-any.whl

Release files / digital_invoice-0.9.6.1792506571-py3-none-any.whl

Download URL digital_invoice-0.9.6.1792506571-py3-none-any.whl
Size 478.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a0747e293b28b5e7b4c68ee202d27ba0e73f7667b456972f80f5bdcd3af7203
BLAKE2b-256 checksum
How to use checksums
32f8b7245001362d91d19c28b467ed7b580cd29715c717e99a12f0fd145f99d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for digital-invoice 0.9.6.1792506571

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page