Skip to content
Snippets Groups Projects

QR Codes now work with mpl and image engine.

Merged Mayr, Hannes requested to merge qrcode into dev
11 files
+ 52
9
Compare changes
  • Side-by-side
  • Inline
Files
11
+ 22
0
@@ -7,6 +7,7 @@ Functions:
"""
import time
import uuid
import qrcode
def create_id(id_method):
@@ -40,3 +41,24 @@ def create_id(id_method):
'"time": Unix time converted to hexadecimal\n'
'"random": Random UUID')
return figure_id
def create_qrcode(figure_id):
"""
Create a QR Code from an identifier.
Parameters
----------
figure_id : str
Identifier which will be embedded in the qrcode.
Returns
-------
QR Code as PilImage.
"""
qrc = qrcode.QRCode(version=1, box_size=10, border=0)
qrc.add_data(figure_id)
qrc.make(fit=True)
img = qrc.make_image(fill_color="black", back_color="white")
return img
Loading