Skip to main content

A QR code generator written purely in Python 3 and 2.7 with SVG and PNG output.

Project description

The pyqrcode module is a QR code generator that is simple to use and written in pure python 3. The module automates most of the building process for you. Generally, QR codes can be created using only two lines of code!

Unlike other generators, all of the automation can be controlled manually. You are free to set any or all of the properties of your QR code.

QR codes can be saved as SVG, PNG (by using the pypng module), and plain text. PIL is not used to render the image files.

The pyqrcode module attempts to follow the QR code standard as closely as possible. The terminology and the encodings used in pyqrcode come directly from the standard. This module also follows the algorithm laid out in the standard.

Homepage: https://github.com/mnooner256/pyqrcode

Documentation: http://pythonhosted.org/PyQRCode/

Requirements

The pyqrcode module only requires Python 2.7 or Python 3. You may want to install pypng in order to render PNG files, but it is optional. Note, pypng is a pure python PNG writer which does not require any other libraries.

Installation

Installation is simple. It can be installed from pip using the following command:

$ pip install pyqrcode

or from the code:

$ python setup.py install

Usage

The pyqrcode module aims to be as simple to use as possible. Below is a simple example of creating a QR code for a URL. The code is rendered out as an svg file.

>>> import pyqrcode
>>> url = pyqrcode.create('http://uca.edu')
>>> url.svg('uca-url.svg', scale=8)

The pyqrcode module, while easy to use, is powerful. You can set every property of the QR code. If you install the optional pypng module, you can render the code as a PNG image. Below is a more complex example:

>>> big_code = pyqrcode.create('0987654321', error='L', version=27, mode='binary')
>>> big_code.png('code.png', scale=6, module_color=[0, 0, 0, 128], background=[0xff, 0xff, 0xcc])

Project details


Download files

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

Source Distributions

PyQRCode-1.0.zip (32.5 kB view details)

Uploaded Source

PyQRCode-1.0.tar.gz (27.7 kB view details)

Uploaded Source

File details

Details for the file PyQRCode-1.0.zip.

File metadata

  • Download URL: PyQRCode-1.0.zip
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyQRCode-1.0.zip
Algorithm Hash digest
SHA256 915216f6b290b170955492d93f49410cdaf6dd06dfdde02f7b2e49be2f8296d0
MD5 c2cf9b6cd4eb2ab18f60638b406117a0
BLAKE2b-256 868a643858a684f77c7701a24fbb27334e43a4311d67e39140461d8851323376

See more details on using hashes here.

File details

Details for the file PyQRCode-1.0.tar.gz.

File metadata

  • Download URL: PyQRCode-1.0.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyQRCode-1.0.tar.gz
Algorithm Hash digest
SHA256 9fa43d63d694b6988835c531ec323b7943889ad6cc1770a1c69dd9e58b2090f1
MD5 f40a53b0587caa3c08affbb74b69843f
BLAKE2b-256 f961797c3ed65889ccb7672e6d873be3a3a7ddaaba612196e199a4738d9ddf78

See more details on using hashes here.

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