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-0.11.zip (30.7 kB view details)

Uploaded Source

PyQRCode-0.11.tar.gz (26.0 kB view details)

Uploaded Source

File details

Details for the file PyQRCode-0.11.zip.

File metadata

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

File hashes

Hashes for PyQRCode-0.11.zip
Algorithm Hash digest
SHA256 da9268a8b0982fcb35e8c068d59689171cc63e218c2fcff83b7067d5ae32e607
MD5 64a7a9c921dc1b669180e97be4884a68
BLAKE2b-256 6bec79dcb5f3cb605f6d26fedc67a3f5ee9d6c41b0b36fbc8cf83937a9edc0aa

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for PyQRCode-0.11.tar.gz
Algorithm Hash digest
SHA256 6a69100661da24a5ad082ff96babe7e3c8d23c251a382206d5e82f00555a57c4
MD5 d4a22dea2d891812647c1ef489bb64da
BLAKE2b-256 e1b8896e2fd73eba0d900d424ad81aa6756d29fca74e0970e4e9de99161a82da

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