Skip to content

A simple Python CLI tool to generate QR codes from URLs with optional logo embedding

License

Notifications You must be signed in to change notification settings

min-hsao/createqrcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

createqrcode

A simple Python CLI tool to generate QR codes from URLs. Supports optional logo embedding in the center of the QR code.

Features

  • Generate QR codes from any URL or text
  • Optional logo/image embedding in the center
  • ASCII preview in terminal
  • Saves as PNG file

Installation

Prerequisites

  • Python 3.6 or higher

Install dependencies

pip install -r requirements.txt

Or install manually:

pip install qrcode[pil] Pillow

Usage

Basic usage

python createqrcode.py 'https://example.com' output.png

With a logo

python createqrcode.py 'https://example.com' output.png --logo logo.png

Arguments

Argument Required Description
url Yes The URL or text to encode in the QR code
output_file Yes The output PNG file path
--logo No Path to a logo image to embed in the center

Examples

Generate a simple QR code:

python createqrcode.py 'https://github.com/min-hsao' github-qr.png

Generate a QR code with your company logo:

python createqrcode.py 'https://mycompany.com' company-qr.png --logo company-logo.png

How it works

  • When no logo is specified, the script uses low error correction (ERROR_CORRECT_L) for a cleaner QR code
  • When a logo is added, it automatically switches to high error correction (ERROR_CORRECT_H) to ensure the QR code remains scannable
  • The logo is automatically resized to 25% of the QR code size

License

MIT License - see LICENSE for details.

Author

Min-Hsao Chen

About

A simple Python CLI tool to generate QR codes from URLs with optional logo embedding

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages