felipemaion / qr_code

Code to generate QR-CODE from a url, adding a logo and a title.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QR CODE

Example of QR-CODE
Script to generate QR-CODE from a url, adding a logo and a title.

Installation

Use the package manager pip to install dependencies.

pip install pillow
pip install pyqrcode

Usage

1 - Add display 'name' and shorten link 'url' to a dict (product).

product = {"name":"TITLE", "url":"your_url"}

1.1 If you are performing a bulk operation. Add the product dict to the list 'products'.

products = [product1, product2,...] 

2 - Call:

convert(product:dict)

or bulk usage:

convert_all(products:list)

Notes:

(1) for the first run, you may need to add a dummy 'test.png' file to your folder.  
(2) the font of your choice must be in the folder if you want to use it (optional)  
(3) for the bulk operation, use links with same pattern, otherwise QR-CODE size will be different amoung them.  

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate. (Well, the main is pretty much a test :-/ )

License

MIT

About

Code to generate QR-CODE from a url, adding a logo and a title.

License:MIT License


Languages

Language:Python 100.0%