Skip to main content

Python port for kozakdenys/qr-code-styling

Project description

[WIP] QRCode Styled Generator

This is a python port for a browser QRCode generator by Denys Kozak

from qrcode_styled import QRCodeStyled

qr = QRCodeStyled()

# Save to file
with open('test.webp', 'wb') as _fh:
    qr.get_image('payload').save(_fh, 'WEBP', lossless=False, quaility=80, method=2)

# Get to BytesIO buffer
qrcode = qr.get('payload', _format='WEBP', lossless=False, quality=80, method=2)


# Also supports basic asyncio workaround
async def main():
    with open('test.webp', 'wb') as fh:
        img = await qr.get_image_async('payload')
        img.save(fh, 'WEBP', lossless=False, quaility=80, method=2)

    qrcode = await qr.get_async('payload', _format='WEBP', lossless=False, quality=80, method=2)


# You may put Image in the center of a QR Code

from PIL import Image

im = Image.open('image.png')
qrcode = qr.get('payload', im, _format='WEBP')

Example 1

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

qrcode_styled-0.1.0.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

qrcode_styled-0.1.0-py3-none-any.whl (14.5 kB view hashes)

Uploaded Python 3

Supported by

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