Skip to content
A pure Python QR-Code Generator
Find file
Pull request Compare This branch is 8 commits ahead of hcvst:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


PYQR - A pure Python QR-Code Generator
Author : Hans Christian von Stockhausen [hc at vst dot io]
Date   : 2010-08-09
Web    :

This is a pre alpha release /!\

One can generate the following codes: 1-M, 1-H, 2-L, 3-L 
Alphanumeric and binary encoding are supported. Note, that alphanumeric mode is 
NOT casesensitive.

To save a qr code to file.
>>> import qrcode
>>> qrc = qrcode.QRCode() 
>>> qrc.encode("HTTP://QR-CODE.CO.ZA") 
>>> img = qrc.to_image()

To display a qr code as text. 
>>> import qrcode
>>> qrc = qrcode.QRCode() 
>>> qrc.encode("HTTP://QR-CODE.CO.ZA")
>>> s = qrc.to_string(on='g') # g rendered as black box when font set to Webdings
>>> print(s)

* update testcases
* clean up, refactor rewrite
  * validate input lengths
  * encapsule the various specification tables
  * look into the bitlist helper
  * use appends instead of concats with lists
* make code more robust or at least crash rather than producing garbage
* optimal mask selection (currently 011 is used)
* add support for version > 3
* automatically select version that best fits data if none specified
* add support for microqr

Too many to list

Generating a 1-M for too long input results in a code that crashes the Android barcode
scanner. Probably due to some incorrect padding (0000 and 236,17) on my side.

The file is copyright Emin Martinian, 2002. See for license terms.
All other files are copyright Hans Christian von Stockhausen, 2010. See LICENSE file for terms.
Something went wrong with that request. Please try again.