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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

digital_invoice-0.9.4.1783418172-py3-none-any.whl (478.1 kB view details)

Uploaded Python 3

File details

Details for the file digital_invoice-0.9.4.1783418172-py3-none-any.whl.

File metadata

File hashes

Hashes for digital_invoice-0.9.4.1783418172-py3-none-any.whl
Algorithm Hash digest
SHA256 c419432543a9d880173b41e774e98998d1de1fa03c22bede0740e28df4e4fb2f
MD5 44e25b8307d0b78d4de3dab768d7852d
BLAKE2b-256 6ced61a9f38ba02e33efc65b9153ab3e7c402a8a3bd0542a7cfeee485b6c109c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.9.4.1783418172 This release

1 file

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