Skip to content

alexhey1999/Python-QR-Code-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python QR Code Generator

Python Dependencies GitHub Issues License

This allows for dynamic QR Codes to be created with images on top.

This is a Python 3 implementation using the qrcode library and PIL

Installation

# clone the repo
$ git clone https://github.com/alexhey1999/Python-QR-Code-Generator.git

# change the working directory to Python QR Code Generator
$ cd Python-QR-Code-Generator

# install the requirements
$ python3 -m pip install -r requirements.txt

Usage

$ python3 QRGenerator.py --help
usage: QRGenerator.py [-h] --type TYPE [--image IMAGE] [--out OUT] [--colour COLOUR]
                      [--backgroundColour BACKGROUNDCOLOUR] [--scale SCALE] [--version VERSION] [--boxSize BOXSIZE]
                      [--firstName FIRSTNAME] [--lastName LASTNAME] [--organization ORGANIZATION] [--email EMAIL]
                      [--phone PHONE] [--address ADDRESS] [--postcode POSTCODE] [--url URL] [--text TEXT]

This program generates QR Codes for information provided. Allows images to be added to the QR Codes.

optional arguments:
  -h, --help            show this help message and exit
  --type TYPE
  --image IMAGE         Path to the image
  --out OUT             Change the output file name
  --colour COLOUR       Change the colour of the QR Code
  --backgroundColour BACKGROUNDCOLOUR
                        Change the background colour of the QR Code
  --scale SCALE         Change the scale of the image. 1 is the same resolution as raw image
  --boxSize BOXSIZE     Change the resolution of the final QR Code
  --firstname FIRSTNAME
  --lastName LASTNAME
  --organization ORGANIZATION
  --email EMAIL
  --phone PHONE
  --address ADDRESS
  --postcode POSTCODE
  --url URL
  --text TEXT

To generate a QR Code with a single link and image
python3 QRGenerator.py --type url --image {image-file} --colour {hex-color} --url {url}

To generate a QR Code with contact information

python3 QRGenerator.py --type contact --image {image-file} --colour {hex-color} --firstname {firstname} --lastname {lastname} --organization {organization} --email {email} --phone {phone} --address {address} --postcode {postcode}

To generate a QR Code with simple text

python3 QRGenerator.py --type text --image {image-file} --colour {hex-color} --text {text}

Special Thanks

Thanks to https://github.com/nkmk for the general guide found here https://note.nkmk.me/en/python-pillow-qrcode/

Thank you also to https://github.com/arasatasaygin for the open source template logo arasatasaygin/openlogos#17


About

Allows creation of QR Codes using the qrcode library and PIL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages