# Welcome

PyPI version codecov FOSSA Status

# QRCode Styled [WIP]

QRCode Styled

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

This project was initially created for internal use in cifrazia.com.

We do not intend to maintain this project for wide usage, but feel free to use it, share, edit or submit pull requests.

# Features

  • Multiple formats:
    • SVG using xmls
    • PNG/WEBP, etc. using Pillow
  • Multiple styles:
    • Extra rounded corners
    • Rounded corners
    • Straight
    • Dotted

Check out our documentation.

# Installing

Using Poetry

poetry add qrcode-styled

Using PIP

pip install qrcode-styled

# Requirements

  • Python >= 3.9
  • Pillow >= 8.2.0
  • qrcode >= 6.1
  • lxml >= 8.2.0 (optional, for SVG rendering)

# Extras

Keyword Description Packages
svg Allows you to generate SVG lxml >= 4.6.3
SVG WEBp
Svg QRCode Svg QRCode

# Usage

from PIL import Image

from qrcode_styled import ERROR_CORRECT_Q, QRCodeStyled

qr = QRCodeStyled()

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

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

# You may put Image in the center of a QR Code
im = Image.open('image.png')

qr.error_correction = ERROR_CORRECT_Q
qrcode = qr.get_buffer('payload', image=im, _format='WEBP')

# Print real bytes from buffer
print(qrcode.getvalue())

FOSSA Status
FOSSA Status