Metadata-Version: 2.1
Name: zakatqr
Version: 1.2.2
Summary: Django App to Create Zakat Invoice QR Code Image
Home-page: https://github.com/halmogbl/zakat_qr
Author: Hamad
Author-email: hamad.almogbl@gmail.com
Maintainer: Hamad
Maintainer-email: hamad.almogbl@gmail.com
License: MIT
Keywords: django zakat invoice qrcode qr base64 encode
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: uttlv
Requires-Dist: qrcode

<div align="center">
    <h1>Django Zakat QR Code </h1>
    <p><strong>Unofficial Python Package</strong> to create QR Code Image as Base64 or as PNG for e-invoice system by ZATCA</p>
</div>

## Installation

### PyPi

```bash
$ pip install zakatqr
```

### GitHub

```bash
$ 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

```python
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

```python
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


```python
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")
```

![qrcode](https://user-images.githubusercontent.com/47291955/152148241-daaabd0f-3c16-4a58-8678-106e835eb488.png)


