Skip to main content

Dash component to create and read QR codes.

Project description

Dash QR Manger is a Dash component based on react-google-qrcode and react-qr-reader for creating and reading QR codes.

Installation

pip install dash-qr-manager

Usage

Creating QR code

import dash_qr_manager as dqm
import dash
import dash_html_components as html

app = dash.Dash(__name__)

app.layout = html.Div(
    children=[
        dqm.DashQrGenerator(
            id='qr-code',
            data='http://example.com/',
            framed=True,
        )
    ]
)

if __name__ == '__main__':
    app.run_server(debug=True)

Reading QR code

import dash_qr_manager as dqm
import dash
from dash.dependencies import Input, Output
import dash_html_components as html

app = dash.Dash(__name__)

app.layout = html.Div(
    children=[
        dqm.DashQrReader(
            id='qr-code-reader',
            style={'width': '50%'}
        ),
        html.Div(id='qr-code-data')
    ]
)


@app.callback(
    Output('qr-code-data', 'children'),
    Input('qr-code-reader', 'result')
)
def code(qr_code_data):
    return qr_code_data


if __name__ == '__main__':
    app.run_server(debug=True)

Documentation

DashQrGenerator

Keyword arguments:

- id (string; optional):
    The ID used to identify this component in Dash callbacks.

- data (string; optional):
    The data to encode.

- framed (boolean; optional):
    Adds a frame to the image.

- size (number; optional):
    Image size in pixels (width x height). Min value: 30, Max value:
    547.

- style (dict; optional):
    The style of the QR code.

for more information: https://www.npmjs.com/package/react-google-qrcode

DashQrReader

Keyword arguments:

- id (string; optional):
    The ID used to identify this component in Dash callbacks.

- className (string; optional):
    ClassName for the container element.

- containerStyle (dict; optional):
    Style object for the container element.

- result (string; optional):
    decoded data.

- scanDelay (number; optional):
    The scan period for the QR hook.

- style (dict; optional):
    The style of the QR code.

- videoContainerStyle (dict; optional):
    Style object for the video container element.

- videoId (string; optional):
    The ID for the video element.

- videoStyle (dict; optional):
    Style object for the video element.

for more information: https://www.npmjs.com/package/react-qr-reader

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_qr_manager-0.0.3.tar.gz (174.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_qr_manager-0.0.3-py3-none-any.whl (175.1 kB view details)

Uploaded Python 3

File details

Details for the file dash_qr_manager-0.0.3.tar.gz.

File metadata

  • Download URL: dash_qr_manager-0.0.3.tar.gz
  • Upload date:
  • Size: 174.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for dash_qr_manager-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6c03ffd020d45524b79cfc43d9a9b0a1384b131334d09f0239a0c614db754071
MD5 7782534aa68a3aa1a35a67163beae4ab
BLAKE2b-256 66f737bb3e3ad36fed0316e5b07f220600b9d450823b26b16bf9848bb82cbbe2

See more details on using hashes here.

File details

Details for the file dash_qr_manager-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for dash_qr_manager-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8290d7a31b671de0fdb9975f8808f18684584ba4ca2571ab19bf359fcebb1bd7
MD5 d303ab9d16333b07085221c5b4d56884
BLAKE2b-256 d06034d1e7090c03c5a3f01f66cc0a886c2b9670b76561f8d91c199de87742a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page