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…

这是做什么的?Amazing-QR 是一个 Python 二维码生成器,可以生成普通二维码、与图片融合的艺术二维码(黑白或彩色),以及动态 GIF 二维码。
它是命令行工具还是 Python 库?两者都是:在终端里用会得到 amzqr 命令;用导入的方式则可以在自己的 Python 代码里用相同的参数来生成二维码。
怎么生成我的第一个二维码?传入一个网址或一句话来运行,它会在当前目录生成 qrcode.png;用 -n 可以自定义文件名,用 -d 可以指定其他输出目录。
运行它需要装什么?只要有 Python 3 就行,没有列出其他运行环境要求。
用图片选项有什么要注意的地方?尽量选接近正方形的图片而不是长条形的,图片较大时要选更大的 -v 值,并且避免透明区域——透明部分显示效果很差,除非改成白色。
它对操作系统有要求吗?作为终端工具,凡是能运行 Python 3 的地方都能用,包括 Windows、macOS 和 Linux;没有网页版或手机版。
可以免费使用吗?可以,它基于 GPLv3 许可证免费开源。
-con 和 -bri 参数对融合的图片有什么作用?它们分别调整对比度和亮度,默认值都是 1.0;数值越大效果越强,可以用来调节图片在二维码中显现的清晰程度。
带图片的艺术二维码还能稳定扫出来吗?默认设置就是为这个调校的:纠错等级默认为最高的 H 级,而且那些提示(用接近正方形的图片、大图片用更大的 -v、把透明区域改成白色)都是为了保证可扫性。
动态 GIF 二维码也能做成彩色的吗?可以——同样适用颜色选项:传入 .gif 文件,就能生成黑白或彩色的动态二维码。
Creator
x-hw
Size
8.2 MB
Stars
10.8K
Updated
CommitSep 17
Age
10y
Commits · 90 Days