Skip to main content

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.

PyPI version


📋 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

qrzatca-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

qrzatca-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file qrzatca-0.1.1.tar.gz.

File metadata

  • Download URL: qrzatca-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for qrzatca-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ad737d9556d20ecc17e74158679b89ed7e0b2c6b7231741c89bbe94133270e57
MD5 564759f2bfc2b3ac3ab3838db93b6ce6
BLAKE2b-256 7403d4767b6174869d8c0359646c7f89e1f4fb9241db4409e8be8605d13036f4

See more details on using hashes here.

File details

Details for the file qrzatca-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: qrzatca-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for qrzatca-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88f8df0bb629cebd4682291826a80bf6695196a3ceb2874ffb1e62810718022b
MD5 744e7e1825ebba5df9313b63ce534b14
BLAKE2b-256 a81ee8343c42df55b13e757dcc5ed8e9d1425ac06825552fd41eda2dc707b261

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page