A Python library to generate ZATCA-compliant QR codes for Saudi Arabian e-invoices.
Project description
ZATCA QR
A Python library for generating ZATCA-compliant QR codes for Saudi Arabian e-invoices.
📋 Description
qrzatca is a lightweight and developer-friendly Python package designed to help businesses in Saudi Arabia comply with ZATCA (Zakat, Tax, and Customs Authority) e-invoicing regulations.
This library encodes invoice information using TLV (Tag-Length-Value) format and generates QR codes containing:
- Seller name
- VAT registration number
- Invoice timestamp
- Invoice total amount
- VAT amount
These QR codes can be used in invoice PDFs, printed receipts, and digital documents to meet ZATCA Phase I & II compliance.
✅ Key Features
- 🔒 ZATCA-compliant QR code generation
- 📦 Encodes seller, VAT, timestamp, amount, and tax
- 🖼️ Returns image as a Pillow object (customizable or savable)
- 🧩 Easy integration into Django, Flask, or standalone Python apps
- ⚙️ Minimal dependencies (
qrcode,Pillow)
🧾 Usage Example
from qrzatca import create_zatca_qr
# Input invoice data
seller_name = "ABC Trading Co."
vat_number = "123456789012345"
invoice_time = "2025-04-25T12:30:00Z"
total_amount = 2500.00
vat_amount = 375.00
# Generate the ZATCA-compliant QR code
qr_image = create_zatca_qr(
seller_name=seller_name,
tax_number=vat_number,
invoice_time=invoice_time,
total_amount=total_amount,
tax_amount=vat_amount
)
# Save the image to a file
qr_image.save("zatca_invoice_qr.png")
# Or display it directly (if using Jupyter or a GUI app)
qr_image.show()
📦 Installation
Install directly from PyPI:
pip install qrzatca
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qrzatca-0.1.3.tar.gz.
File metadata
- Download URL: qrzatca-0.1.3.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50281687a8d982a6bcfa7a2be221622cbbf748fbf81ccc77fcb5e4d09de34e89
|
|
| MD5 |
c96d497713b87fb9edb86ae41d91af77
|
|
| BLAKE2b-256 |
3605b835c59f2f804e40e60f99ccdad9aef1074d7906f48d0036dc364bf246ff
|
File details
Details for the file qrzatca-0.1.3-py3-none-any.whl.
File metadata
- Download URL: qrzatca-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a155ef6775b5cddd825fb245a2d0f3b93801b6fe9475e96b44e25d4f2ac55ed
|
|
| MD5 |
f677a9aa4a3763ce23eae38b3c54e39e
|
|
| BLAKE2b-256 |
780d42f7aab5a0651d15b57ff03128e77d1583e26889c8a04b4bfc0e8b144d43
|