Giter Club home page Giter Club logo

fatoora's Introduction

theawiteb

Important

I moved to https://git.4rs.nl (personal Forgejo instance)

Hi ๐Ÿ‘‹, I'm Awiteb

A passionate developer

Fediverse Telegram
github-sponsors

Donating

Currency Address
Solana SOL AxLx5ynVTMkxwVJyNz77S4ZXLMToCjrTFtYkYGjfwQyJ
Ethereum ETH 0xD89c146B03B72191be91064D313610981dCAF6d4
Binance BNB BEP20 0xD89c146B03B72191be91064D313610981dCAF6d4
USD Coin USDC BEP20 0xD89c146B03B72191be91064D313610981dCAF6d4
Bitcoin BTC bc1q0ltmqmsc4qs740ssyf9k9jq99nwxtqu8aupmdj
Bitcoin Cash BCH qrpm6zyte3d4z2u9r24l04m3havc2wd9vgqlz8sjgr

fatoora's People

Contributors

dependabot[bot] avatar engfarisalsmawi avatar theawiteb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fatoora's Issues

Make zbar optional, or replace it

Bug

zbar is an old library that is being removed from different Linux repositories.
I suggest that instead of make it a mandatory, we make it optional (via a try/except) and the read_qrcode throws an exception if zbar is not installed (as I see, it's used only for decoding the QR image).

Or (better), we replace it with something else, if exists.

Thanks for working on this. Helped a lot implementing ZATCA's e-invoicing :)

invoice date timestamp not work with VAT app

you have issue with invoice date timestamp
invoice date must be datetime as string not timestamp float..

datetime must be convert to string using this patch code:

invoice_date.isoformat()[:-6] + "Z",


Thank you for this package
Best regards,

[Bug]: `read_qrcode` panic when read a qr code contain a url

Checks

  • I added a descriptive title to this issue
  • I have searched (google, github) for similar issues and couldn't find anything
  • I have read and followed the docs and still think this is a bug

Bug

When trying to read a qr code contain a url and set the value of dct to True, the function will panic

Code

from fatoora import Fatoora


obj = Fatoora(
    seller_name="Awiteb",
    tax_number=1234567891,
    invoice_date=1635872693.3186214,
    total_amount=100,
    tax_amount=15,
    qrcode_url="https://example.com",
)

obj.qrcode("tests.png")
obj.read_qrcode("tests.png", dct=True)

Error message

Traceback (most recent call last):
  File "~/Desktop/projects/python-projects/fatoora/t.py", line 14, in <module>
    obj.read_qrcode("tests.png", dct=True)
  File "~/Desktop/projects/python-projects/fatoora/fatoora/fatoora.py", line 127, in read_qrcode
    return cls.base2dict(data)
  File "~/Desktop/projects/python-projects/fatoora/fatoora/fatoora.py", line 98, in base2dict
    decoded = base64.b64decode(base)
  File "/usr/lib/python3.10/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (17) cannot be 1 more than a multiple of 4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.