Retour au classement

x-hw/amazing-qr

Python

💮 amazing QRCode generator in Python (supporting animated gif) - Python amazing 二维码生成器(支持 gif 动态图片二维码)

qrcodegifamazingpictureqr-codeqrcode-generator
Croissance des étoiles
Étoiles
10.8k
Forks
1.6k
Croissance hebdomadaire
Issues
55
5k10k
août 2016nov. 2019mars 2023juil. 2026
ArtefactsPyPIpip install amazing-qr
README

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]

Common QR-Code

#1 Words
amzqr https://github.com
  • Just input a URL or a sentence, then get your QR-Code named 'qrcode.png' in the current directory.
#2 -v, -l
amzqr https://github.com -v 10 -l Q
  • The default size of QR-Code depends both on the numbers of words you input and the level, while the default level (Error Correction Level) is H (the highest).

  • Customize: If you want to control the size and the error-correction-level, use the -v and -l arguments.

    -v representing the length is from a minimum of 1 to a maximum of 40.

    -l representing the error correction level is one of L, M, Q and H, where L is the lowest level and H is the highest.

#3 -n, -d
amzqr https://github.com   -n github_qr.jpg   -d .../paths/
  • The default output-filename is 'qrcode.png', while the default output-directory is current directory.

  • Customize: You can name the output-file and decide the output-directory. Notice that if the name is as same as a existing file, the old one will be deleted.

    -n representing the output-filename could be in the format one of .jpg.png.bmp.gif .

    -d means directory.

Artistic QR-Code

#1 -p
amzqr https://github.com -p github.jpg
  • The -p is to combine the QR-Code with the following picture which is in the same directory as the program. The resulting picture is black and white by default.
#2 -c
amzqr https://github.com -p github.jpg -c
  • The -c is to make the resulting picture colorized.
#3 -con, -bri
amzqr https://github.com -p github.jpg [-c] -con 1.5 -bri 1.6
  • The -con flag changes the contrast of the picture - a low number corresponds to low contrast and a high number to high contrast. Default: 1.0.

  • The -bri flag changes the brightness and the parameter values work the same as those for -con. Default: 1.0.

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

  • Use a nearly square picture instead of a rectangle one.

  • If the size of the picture is large, you should also choose a rightly large -v instead of using the default one.

  • If part of the picture is transparent, the qr code will look like:

    You can change the transparent layer to white, and then it will look like:

Supported Characters

  • Numbers: 0~9

  • Letters: a~z, A~Z

  • Common punctuations:

    · , . : ; + - * / \ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and  (space)
    

Environment

  • Python 3

License

  • GPLv3

Buy me a coffee

GitHub Sponsors

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

wechatpay

wechatpay

alipay

alipay

🎉🎉🎉 Thanks for your support. 🎉🎉🎉

Dépôts similaires
Tamsiree/RxTool

Android开发人员不得不收集的工具类集合 | 支付宝支付 | 微信支付(统一下单) | 微信分享 | Zip4j压缩(支持分卷压缩与加密) | 一键集成UCrop选择圆形头像 | 一键集成二维码和条形码的扫描与生成 | 常用Dialog | WebView的封装可播放视频 | 仿斗鱼滑动验证码 | Toast封装 | 震动 | GPS | Location定位 | 图片缩放 | Exif 图片添加地理位置信息(经纬度) | 蛛网等级 | 颜色选择器 | ArcGis | VTPK | 编译运行一下说不定会找到惊喜

KotlinApache License 2.0dialogprogressbar
12.3k2.8k
claudiodangelis/qrcp

:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.

GoGo ModulesMIT Licenseutilitygolang
qrcp.sh
10.5k546
mrousavy/react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.

TypeScriptnpmMIT Licensereact-nativecamera
visioncamera.margelo.com
9.5k1.4k
bingoogolapple/BGAQRCode-Android

QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式

Cqrcodeqrcode-scanner
8k1.8k
ggerganov/ggwave

Tiny data-over-sound library

C++MIT Licensedata-over-soundsound-library
youtu.be/Zcgf77T71QM
7.8k460
bndw/wifi-card

📶 Print a QR code for connecting to your WiFi (wificard.io)

JavaScriptnpmMIT Licensewifireact
wificard.io
7.2k498
latentcat/qrbtf

AI & parametric QR code generator. AI & 参数化二维码生成器。https://qrbtf.com

TypeScriptnpmGNU General Public License v3.0qrqrcode
qrbtf.com
7k589
mebjas/html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org

TypeScriptnpmApache License 2.0html5qrcode
qrcode.minhazav.dev
6.2k1.1k
zxlie/FeHelper

😍FeHelper--Web前端助手(Awesome!Chrome & Firefox & MS-Edge Extension, All in one Toolbox!)

JavaScriptnpmMIT Licensefehelperjson
fehelper.com
5.6k1.3k
Shane32/QRCoder

A pure C# Open Source QR Code implementation

C#MIT Licenseqrcodec-sharp
5.1k1.2k
endroid/qr-code

PHP QR Code library that helps you create QR codes in a jiffy

PHPPackagistMIT Licenseqrcodedata-uri
endroid.nl
4.8k770
codebude/QRCoder

A pure C# Open Source QR Code implementation

C#MIT Licenseqrcodec-sharp
4.8k1.1k