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.2.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.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qrzatca-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 8611a2df162ad2c8f083685f10b28c7ed4d7402414a5ca5d0835a36713ee03dc
MD5 d39e33acb0e8f388e85a4bb9d46471a6
BLAKE2b-256 da015da490fa25e44e36d6e03551c59cb2421761518c1abb202b5848bce36680

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qrzatca-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 869308e951fece947d5e8f2381f1559cde7129aa0a6614b765e03dae78c6f1ec
MD5 218fc9788f6e25ec3475ad2dd8ce1211
BLAKE2b-256 e741e0a58557c88be84a10544417e915d7b0c260d739635f98998faca1aa9d05

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