flask_qrcode package¶
Module contents¶
Copyright (C) 2016 Marco Agner
This file is part of Flask-QRcode.
Flask-QRcode is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Flask-QRcode is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Flask-QRcode. If not, see <http://www.gnu.org/licenses/>.
-
class
flask_qrcode.
QRcode
(app=None, config_jinja=True, **kwargs)¶ Bases:
object
QR Code image class
-
color
= ['red', 'maroon', 'olive', 'yellow', 'lime', 'green', 'aqua', 'teal', 'blue', 'navy', 'fuchsia', 'purple', 'white', 'silver', 'gray', 'black']¶
-
correction_levels
= {'H': 2, 'L': 1, 'M': 0, 'Q': 3}¶
-
init_app
(app)¶
-
classmethod
qrcode
(data, mode='base64', version=None, error_correction='L', box_size=10, border=0, fit=True, fill_color='black', back_color='white', image_factory=None, **kwargs)¶ Makes qr image using qrcode as qrc. See documentation for qrcode (https://pypi.python.org/pypi/qrcode) package for more info.
Parameters: - data – String data.
- mode – Output mode, [base64|raw].
- version – The size of the QR Code (1-40).
- error_correction – The error correction used for the QR Code.
- box_size – The number of pixels for each “box” of the QR code.
- border – The number of box for border.
- fit – If True, find the best fit for the data.
- fill_color – Frontend color.
- back_color – Background color.
- image_factory – Image factory, optional
- icon_img – Small icon image name or url.
- factor – Resize for icon image (default: 4, one-fourth of QRCode)
- icon_box – Icon image position [left, top] (default: image center)
-
register_blueprint
(app)¶
-