Skip to main content

Django App to Create Zakat Invoice QR Code Image

Project description

Django Zakat QR Code

Unofficial Python Package to create QR Code Image as Base64 or as PNG for e-invoice system by ZATCA

Installation

PyPi

$ pip install zakatqr

GitHub

$ git clone https://github.com/halmogbl/zakat_qr
$ cd zakat_qr
$ python3 setup.py install

Usage

Variables

Zakatqr class's variables and descriptions

Variable Name Description
seller_name Seller’s name.
tax_number Seller’ tax number, which is the VAT registration number.
timestamp Invoice date, which is the timestamp of the electronic invoice.
total_with_vat Invoice total amount, which is the electronic invoice total with VAT.
total_vat Tax amount, which is the VAT total.

Generate Base64

from zakatqr import Zakatqr

invoice = Zakatqr(
    seller_name="Example",
    tax_number="123456789", 
    timestamp="2021-06-25 07:58:56.550604", 
    total_with_vat="115",
    total_vat="15",
)

print(invoice.tlv_to_base64())
# AQdNeSBuYW1lAgkxMjM0NTY3ODkDGjIwMjEtMDYtMjUgMDc6NTg6NTYuNTUwNjA0BAMxMTUFAjE1

Generate A QR Code Image as Base64

from zakatqr import Zakatqr

invoice = Zakatqr(
    seller_name="Example",
    tax_number="123456789", 
    timestamp="2021-06-25 07:58:56.550604", 
    total_with_vat="115",
    total_vat="15",
)

print(invoice.qr_image_encoded_uri())
# data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/...

Create A QR Code Image

from fatoora import Fatoora

invoice = Zakatqr(
    seller_name="Example",
    tax_number="123456789", 
    timestamp="2021-06-25 07:58:56.550604", 
    total_with_vat="115",
    total_vat="15",
)

image = invoice.qr_code()
image.save("qr_code_img.png")

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

zakatqr-1.2.4.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

zakatqr-1.2.4-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

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