Amazing-QR
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]
- see Common QR-Code for
Words,-v,-l,-n,-d - see Artistic QR-Code for
-p,-c,-con,-bri - see Animated GIF QR-Code about GIF
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
-vand-larguments.-vrepresenting the length is from a minimum of 1 to a maximum of 40.-lrepresenting 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.
-nrepresenting the output-filename could be in the format one of.jpg,.png,.bmp,.gif.-dmeans directory.
Artistic QR-Code
#1 -p
amzqr https://github.com -p github.jpg
- The
-pis 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
-cis to make the resulting picture colorized.
#3 -con, -bri
amzqr https://github.com -p github.jpg [-c] -con 1.5 -bri 1.6
-
The
-conflag changes the contrast of the picture - a low number corresponds to low contrast and a high number to high contrast. Default: 1.0. -
The
-briflag 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
-vinstead 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
Since the GitHub Sponsors is unavailable in China yet...
🎉🎉🎉 Thanks for your support. 🎉🎉🎉
Metadata
Release files for amzqr 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| amzqr-0.1.0.tar.gz | 45.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amzqr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.3 kB
Release files / amzqr-0.1.0.tar.gz
| Download URL | amzqr-0.1.0.tar.gz |
|---|---|
| Size | 45.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccf7ad7ea0b05b9db1bae79eb5c109c8a1575a98f7304b85472ea8eb23f52c75
|
|
BLAKE2b-256 checksum How to use checksums |
5b4cf587dac81fe351aaa5d0208aa8a4f47b4387b585de0cf7e87ae752d5d556
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / amzqr-0.1.0-py3-none-any.whl
| Download URL | amzqr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6116b3b1a6dcfd7e4926821434322cc9d9d171944cee44ece233b0de27b76c2
|
|
BLAKE2b-256 checksum How to use checksums |
1dd9d26c60391e0ae46a41db1a3e322d74444dc5d983d55bb192d9c9c1933d16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for amzqr 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.