gulf-einvoicing (Python)
Saudi ZATCA Phase 2 (Fatoora) simplified tax invoices and UAE Peppol PINT AE tax invoices in pure Python. Part of the Gulf e-Invoicing Toolkit by iFynx.
Every output (XML, invoice hash, XAdES properties, signature and QR) is tested to be byte-for-byte identical to the JavaScript engines, using shared test vectors. Signatures use RFC 6979 deterministic nonces with low-S, so the same invoice always signs the same way.
pip install gulf-einvoicing
ZATCA Phase 2
from gulf_einvoicing import zatca
key = zatca.load_private_key(open("private-key.pem").read()) # secp256k1
cert = zatca.cert_info(open("csid-cert.txt").read()) # base64 CSID certificate
signed = zatca.sign_invoice({
"number": "INV-0001", "uuid": "3cf5ee18-ee25-44ea-a444-2c37ba7f28be",
"date": "2026-11-24", "time": "09:30:00",
"counter": 1, "pih": zatca.FIRST_PIH, # ICV + previous invoice hash
"seller": {"name": "My Store", "vat": "399999999900003", "crn": "1010010000",
"street": "King Fahd Road", "building": "1234", "district": "Al Olaya",
"city": "Riyadh", "postal": "12211"},
"lines": [{"name": "Arabic coffee", "qty": 2, "price": 12.5}],
}, key, cert)
signed.xml # signed UBL 2.1 invoice
signed.qr # base64 TLV for the QR code
signed.invoice_hash # store it: the PIH of your next invoice
zatca.validate(invoice) returns the fields that break basic ZATCA rules
(vat, building, postal, name, lines).
UAE PINT AE
from gulf_einvoicing import uae_pint_ae
results = uae_pint_ae.check(invoice) # [{'id': 'IBR-132-AE', 'key': 'trn', 'ok': True}, ...]
if all(r["ok"] for r in results):
xml = uae_pint_ae.invoice_xml(invoice) # send through your Accredited Service Provider
Scope
ZATCA: simplified (B2C) invoices at 15%. UAE: standard tax invoice at 5%, AED. See the main README for limits. This is engineering code, not tax advice.
License
MIT © iFynx Integrated Solutions P.S.C.
Metadata
Release files for gulf-einvoicing 0.1.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 |
|---|---|---|---|---|
| gulf_einvoicing-0.1.0.tar.gz | 11.8 kB | With provenance | Details for gulf_einvoicing-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gulf_einvoicing-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for gulf_einvoicing-0.1.0-py3-none-any.whl |
Total release size: 24.9 kB
Release files / gulf_einvoicing-0.1.0.tar.gz
| Download URL | gulf_einvoicing-0.1.0.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e776329cc09587ccd87599ab017413610b994210f15704da0304113da4eb3dba
|
|
BLAKE2b-256 checksum How to use checksums |
7fd191a765f07aa9ad41d13b77750a2ec23e51ce9300ef65ac1f033bb3ae38fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / gulf_einvoicing-0.1.0-py3-none-any.whl
| Download URL | gulf_einvoicing-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0042d5fc0683f957c292d6098e5f2e0a24719a4e906f9696f8932d710bcb40d
|
|
BLAKE2b-256 checksum How to use checksums |
7a4e13e41b194d01347c5b6aa9de5597e5ba9d65895f2362a3c04cfb62db79e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for gulf-einvoicing 0.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gulf_einvoicing-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA 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.