amazing-qr README

The project's README from github.com/x-hw/amazing-qr. As one markdown file: README.md.

Amazing-QR

former name PyPI - Downloads PyPI - Python Version PyPI PyPI - Wheel PyPI - Downloads PyPI - License GitHub code size in bytes macos linux windows

sponsor

转到中文版

Overview

Python QR Code Generator

Generate common qr-code, artistic qr-code (black & white or colorized), animated qr-code (black & white or colorized).

Contents

Examples

Install

# via pip
pip install amzqr

Usage

Terminal Way

(TIPS: If you haven't install amzqr, you should python(3) amzqr.py instead of amzqr blow.)

# summary
amzqr Words
      [-v {1,2,3,...,40}]
      [-l {L,M,Q,H}]
      [-n output-filename]
      [-d output-directory]
      [-p picture_file]
      [-c]
      [-con contrast]
      [-bri brightness]
      [-V]

Common QR-Code

#1 Words
amzqr https://github.com
#2 -v, -l
amzqr https://github.com -v 10 -l Q
#3 -n, -d
amzqr https://github.com   -n github_qr.jpg   -d .../paths/

Artistic QR-Code

#1 -p
amzqr https://github.com -p github.jpg
#2 -c
amzqr https://github.com -p github.jpg -c
#3 -con, -bri
amzqr https://github.com -p github.jpg [-c] -con 1.5 -bri 1.6

Animated GIF QR-Code

The only difference from Artistic QR-Code mentioned above is that you should input an image file in the .gif format. The you can get your black-and-white or colorful qr-code. Remember that when you use -n to customize the output-filename, then the output-filename must end by .gif.

Import Way

from amzqr import amzqr

version, level, qr_name = amzqr.run(
    words,
    version=1,
    level="H",
    picture=None,
    colorized=False,
    contrast=1.0,
    brightness=1.0,
    save_name=None,
    save_dir=os.getcwd(),
)

details about each parameter are as mentioned above

# help(amzqr)
Positional parameter
   words: str

Optional parameters
   version: int, from 1 to 40
   level: str, just one of ('L','M','Q','H')
   picture: str, a filename of a image
   colorized: bool
   contrast: float
   brightness: float
   save_name: str, the output filename like 'example.png'
   save_dir: str, the output directory

Tips

Supported Characters

Environment

License

Buy me a coffee

GitHub Sponsors

Since the GitHub Sponsors is unavailable in China yet...

wechatpay

wechatpay

alipay

alipay

🎉🎉🎉 Thanks for your support. 🎉🎉🎉

amazing-qr (x-hw/amazing-qr)

Searching Database…

What is this?Amazing-QR is a Python QR code generator that makes common codes, artistic codes blended with a picture (black-and-white or colorized), and animated GIF codes.
Is it a command-line tool or a Python library?Both: the terminal way gives you the amzqr command, while the import way lets you generate codes from your own Python code with the same parameters.
How do I make my first QR code?Run it with a URL or a sentence and it writes qrcode.png to the current directory; -n sets a custom filename and -d a different output directory.
What do I need installed to run it?Just Python 3 — no other runtime requirements are listed.
Any gotchas with the picture options?Choose a nearly square picture rather than a rectangle, pick a larger -v for big images, and avoid transparency — transparent areas render badly unless changed to white.
Does it run on any particular OS?It runs anywhere Python 3 does — Windows, macOS and Linux — as a terminal tool; there is no web or mobile version.
Is it free to use?Yes, it is free and open source under the GPLv3 license.
What do the -con and -bri flags do to a blended picture?They adjust contrast and brightness, both defaulting to 1.0; a higher value means a stronger effect, which helps tune how clearly the picture shows through the code.
Will an artistic code with a picture still scan reliably?That is what the defaults are tuned for: error correction defaults to the highest level H, and the tips (nearly square pictures, larger -v for big images, whitening transparent areas) all serve scannability.
Can animated GIF codes be colorized too?Yes — the same color option applies: feed a .gif and you can get a black-and-white or colorful animated QR code.
Creator
x-hw
Size
8.2 MB
Stars
10.8K
Updated
CommitSep 17
Age
10y
Commits · 90 Days