Skip to content

How to create a variety of QR Codes using the Python qrcode library

Notifications You must be signed in to change notification settings

1homas/QR_Codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Codes

Create QR Codes using the qrcode Python library

Quick Start

  1. Clone this repository

    git clone https://github.com/1homas/QR_Codes.git
  2. Create your Python environment

    pip install pipenv          # Python virtual environment manager
    pipenv install --python 3.9 # Python 3.9+ is currently recommended
    pipenv install pillow       # Python Imaging Library
    pipenv install qrcode       # QR Code library
    pipenv shell                # launch the environment

URL QR Code

  1. Generate a Text QR code for a URL :

    # PNG
    qr "https://github.com/1homas/QR_Codes" > QR_Code.png
    
    # SVG
    qr --factory=svg "https://github.com/1homas/QR_Codes" > QR_Code.svg
    
    # ASCII Characters
    qr --ascii "https://github.com/1homas/QR_Codes" > QR_Code.txt
  2. Preview the images in your OS or a browser and cat the QR_Code.txt file in a terminal with a monospaced font to view it properly:

cat QR_Code.txt

    █▀▀▀▀▀█  ▀  ▄█▄▄▀██▀▄ █▀▀▀▀▀█
    █ ███ █  ▄▄▀██▄▄▀▀▄▀▀ █ ███ █
    █ ▀▀▀ █ ▄▄▄ ▀██ ▀ ▀▄▄ █ ▀▀▀ █
    ▀▀▀▀▀▀▀ ▀▄█▄█ █ ▀▄█ ▀ ▀▀▀▀▀▀▀
    ▀ ▄█▄█▀▄██▄ ▀ ▄█▀▄▄▀▄▀▄▀ ▄  ▄
    █▀█▀ █▀▀ ▄██▄ ▄ ▀▀██▄▀  █▀██
    █ █▀▄█▀█▄ ▄ █    ▀▀▄ █▀  ▀ ▀▀
    ▀▀ ▀ ▄▀▄▄ █▀▄▄▄▄▄▄▄ █▄█▀▀█▀█▀
    ▀  █▀▄▀▄█▀██▀▀▀ ▄ ▄ █▄▄█ ▄ ▀▄
    ▀ ██▄ ▀▀▄▄▀▀▄█ ▄▀▄█ ▄█ ██  ██
    ▀ ▀▀  ▀ █▄▄▄▀▄▀ ██▄██▀▀▀█ █▄▄
    █▀▀▀▀▀█ ▄█ ▄ █▀ █▀▀ █ ▀ █▄▄█▄
    █ ███ █ ▄▄█▀▀▄█▀▀ ▄▄█▀███▄▄▄▀
    █ ▀▀▀ █  ▀ ▀▀▀▀  ▄▄██▄  █▀▀▄▀
    ▀▀▀▀▀▀▀ ▀▀ ▀▀ ▀     ▀▀▀▀▀▀ ▀

URL Code with Logo Image

  1. Edit the qr_urls.py script with your document names and URLs

  2. Save an image named logo.png for the logo in PNG format

  3. Run the script:

    qr_urls.py
  4. Then view the generated image:

    ISE_Resources.QR.png

WiFi QR Code

  1. Edit the qr_wifi.py script with your SSID parameters

  2. Run the script and optionally redirect the HTML output to a file

    qr_wifi.py
    qr_wifi.py > SSID.html

License

This repository is licensed under the MIT License.

About

How to create a variety of QR Codes using the Python qrcode library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages