{"id":13461726,"url":"https://github.com/x-hw/amazing-qr","last_synced_at":"2025-05-14T01:07:23.406Z","repository":{"id":37070953,"uuid":"66557478","full_name":"x-hw/amazing-qr","owner":"x-hw","description":"💮 amazing QRCode generator in Python (supporting animated gif) - Python amazing 二维码生成器（支持 gif 动态图片二维码）","archived":false,"fork":false,"pushed_at":"2023-12-01T12:30:28.000Z","size":8189,"stargazers_count":10425,"open_issues_count":65,"forks_count":1561,"subscribers_count":302,"default_branch":"master","last_synced_at":"2024-10-29T15:04:02.200Z","etag":null,"topics":["amazing","gif","picture","qr-code","qrcode","qrcode-generator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x-hw.png","metadata":{"files":{"readme":"README-cn.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-25T12:51:42.000Z","updated_at":"2024-10-26T10:56:02.000Z","dependencies_parsed_at":"2022-07-11T16:01:55.245Z","dependency_job_id":"701a1c7a-98e6-4531-a1b1-09f897ed7f7e","html_url":"https://github.com/x-hw/amazing-qr","commit_stats":{"total_commits":81,"total_committers":7,"mean_commits":"11.571428571428571","dds":"0.16049382716049387","last_synced_commit":"a773916dcf5bed8fdcd9c492dd552d4044ff568f"},"previous_names":["sylnsfar/qrcode","hwxhw/amazing-qr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-hw%2Famazing-qr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-hw%2Famazing-qr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-hw%2Famazing-qr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-hw%2Famazing-qr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-hw","download_url":"https://codeload.github.com/x-hw/amazing-qr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608160,"owners_count":20965953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazing","gif","picture","qr-code","qrcode","qrcode-generator"],"created_at":"2024-07-31T11:00:54.752Z","updated_at":"2025-04-10T03:39:51.790Z","avatar_url":"https://github.com/x-hw.png","language":"Python","funding_links":["https://github.com/sponsors"],"categories":["Python","Python 程序","Python（165）","Tools"],"sub_categories":["网络服务_其他","WebTools"],"readme":"# Amazing-QR\n\n[![former name](https://img.shields.io/badge/old%20name-MyQR-yellow)](https://pypi.org/project/myqr/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/myqr?label=downloads@myqr)](https://pypi.org/project/myqr/) [![](https://img.shields.io/badge/language-Python-blue)](https://www.python.org/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/amzqr?logo=python\u0026logoColor=ffffff\u0026label=Python\u0026labelColor=blue\u0026color=ffffff) [![PyPI](https://img.shields.io/pypi/v/amzqr?logo=pypi\u0026logoColor=ffffff\u0026label=PyPI\u0026labelColor=blue)](https://pypi.org/project/amzqr/) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/amzqr) [![PyPI - Downloads](https://img.shields.io/pypi/dm/amzqr)](https://pypi.org/project/amzqr/) [![PyPI - License](https://img.shields.io/pypi/l/amzqr)](https://github.com/x-hw/amazing-qr/blob/master/LICENSE.md) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/x-hw/amazing-qr) ![macos](https://img.shields.io/badge/-macOS-black?logo=macos) ![linux](https://img.shields.io/badge/-Linux-yellow?logo=linux) ![windows](https://img.shields.io/badge/-Windows-blue?logo=windows)\n\n[![](https://img.shields.io/badge/GitHub-x.hw-blue?logo=github)](https://github.com/x-hw) [![sponsor](https://img.shields.io/badge/sponsor--pink?logo=github-sponsors\u0026labelColor=pink)](#打赏杯咖啡)\n\n[*back to English*](https://github.com/x-hw/amazing-qr/blob/master/README.md)\n\n## 概述\n\n**Python 二维码生成器**\n\n可生成*普通二维码*、*带图片的艺术二维码（黑白与彩色）*、*动态二维码（黑白与彩色）*。\n\n## Contents 目录\n\n* [Amazing-QR](#amazing-qr)\n  * [概述](#概述)\n  * [目录](#目录)\n  * [示例](#示例)\n  * [安装](#安装)\n  * [使用方法](#使用方法)\n    * [命令行方式](#命令行方式)\n    * [作为导入文件](#作为导入文件)\n  * [使用提示](#使用提示)\n  * [可用字符](#可用字符)\n  * [环境](#环境)\n  * [协议](#协议)\n  * [打赏杯咖啡☕️](#打赏杯咖啡)\n\n## 示例\n\n![](https://github.com/x-hw/amazing-qr/blob/master/example/qrs0.jpg)\n\n![](https://github.com/x-hw/amazing-qr/blob/master/example/qrs1.jpg)\n\n![](https://github.com/x-hw/amazing-qr/blob/master/example/qrs2.jpg)\n\n![](https://github.com/x-hw/amazing-qr/blob/master/example/c_qrcode.gif)![](https://github.com/x-hw/amazing-qr/blob/master/example/daftpunktocat-guy_qrcode.gif)\n\n![](https://github.com/x-hw/amazing-qr/blob/master/example/zootopia_qrcode.gif)![](https://github.com/x-hw/amazing-qr/blob/master/example/daftpunktocat-guy_qrcode0.gif)\n\n\n## 安装\n\n```python\npip install amzqr\n```\n\n## 使用方法\n\n### 命令行方式\n\n*（**提示**：如果你尚未安装 [**amzqr**](https://pypi.python.org/pypi/amzqr) ，以下内容请使用`python(3) amzqr.py` 而非`amzqr` 。）*\n\n```python\n# 概括\namzqr  Words\n      [-v {1,2,3,...,40}]\n      [-l {L,M,Q,H}]\n      [-n output-filename]\n      [-d output-directory]\n      [-p picture_file]\n      [-c]\n      [-con contrast]\n      [-bri brightness]\n```\n\n- [普通二维码](#普通二维码) 介绍了 `Words`, `-v`, `-l`, `-n`, `-d` \n- [艺术二维码](#艺术二维码) 介绍了  `-p`, `-c`, `-con`, `-bri`\n- [动态GIF二维码](#动态gif二维码) 介绍了动态的生成方法和注意点\n\n#### 普通二维码\n\n![](https://github.com/x-hw/amzqr/blob/master/example/0.png)\n\n```markdown\n#1 Words\namzqr https://github.com\n```\n\n* 在命令后输入链接或者句子作为参数，然后在程序的当前目录中产生相应的二维码图片文件，默认命名为” qrcode.png“。\n\n```markdown\n#2 -v, -l\namzqr https://github.com -v 10 -l Q\n```\n\n* **默认边长**是取决于你输入的信息的长度和使用的纠错等级；\n\n  而**默认纠错等级**是最高级的H。\n\n* **自定义**：如果想要控制边长和纠错水平就使用 `-v` 和 `-l` 参数。\n\n   `-v` 控制边长，范围是**1至40**，数字越大边长越大；\n\n   `-l` 控制纠错水平，范围是**L、M、Q、H**，从左到右依次升高。\n\n```markdown\n#3 -n, -d\namzqr https://github.com -n github_qr.jpg  -d .../paths/\n```\n\n- **默认输出文件名**是“ qrcode.png \"，而**默认存储位置**是当前目录。\n\n- 自定义：可以自己定义输出名称和位置。**注意**同名文件会覆盖旧的。\n\n  `-n` 控制文件名，格式可以是 `.jpg`， `.png` ，`.bmp` ，`.gif` ；\n\n  `-d` 控制位置。\n\n  #### 艺术二维码\n\n![](https://github.com/x-hw/amazing-qr/blob/master/example/1.png)![](https://github.com/x-hw/amazing-qr/blob/master/example/2.png)\n\n```markdown\n#1 -p\namzqr https://github.com -p github.jpg\n```\n\n* 参数`-p` 用来将QR二维码图像与一张同目录下的图片相结合，产生一张**黑白**图片。\n\n```markdown\n#2 -c\namzqr https://github.com -p github.jpg -c\n```\n\n* 加上参数 `-c` 可以使产生的图片由黑白变为**彩色**的。\n\n```markdown\n#3 -con, -bri\namzqr https://github.com -p github.jpg [-c] -con 1.5 -bri 1.6\n```\n\n* 参数`-con` 用以调节图片的**对比度**，1.0 表示原始图片，更小的值表示更低对比度，更大反之。**默认为1.0**。\n\n* 参数 `-bri` 用来调节图片的**亮度**，其余用法和取值与 `-con` 相同。\n\n#### 动态GIF二维码\n\n![](https://github.com/x-hw/amazing-qr/blob/master/example/daftpunktocat-guy_qrcode.gif)![](https://github.com/x-hw/amazing-qr/blob/master/example/daftpunktocat-guy_qrcode0.gif)\n\n动态二维码与上述的带图片的二维码的生成方法没什么区别，你只要采用 `.gif` 格式的图片即可生成黑白或者彩色的动态二维码。但**注意**如果使用了 `-n` 参数自定义输出的文件名，切记其格式也必须是 `.gif` 格式。\n\n### 作为导入文件\n\n```python\n# 安装模块后\nfrom amzqr import amzqr\nversion, level, qr_name = amzqr.run(\n    words,\n    version=1,\n    level='H',\n    picture=None,\n    colorized=False,\n    contrast=1.0,\n    brightness=1.0,\n    save_name=None,\n    save_dir=os.getcwd()\n)\n```\n\n*以下各个参数已经在[上文](#命令行方式)有所介绍*\n\n```python\n# help(amzqr)\nPositional parameter\n   words: str\n\nOptional parameters\n   version: int, from 1 to 40\n   level: str, just one of ('L','M','Q','H')\n   picutre: str, a filename of a image\n   colorized: bool\n   constrast: float\n   brightness: float\n   save_name: str, the output filename like 'example.png'\n   save_dir: str, the output directory\n```\n## 使用提示\n\n* 请采用**正方形**或近似正方形的图片\n\n* 建议在图片尺寸大的时候使用 `-v` 的值也应该**适当**变大。\n\n* 如果图片有透明无色部分，最终效果是：![](https://github.com/x-hw/amazing-qr/blob/master/example/aa.png)\n\n  你可以将透明部分修改成白色，最终效果会变成![](https://github.com/x-hw/amazing-qr/blob/master/example/a0.png)\n\n## 可用字符\n\n* 数字 0 到 9\n\n* 大小写的英文字母\n\n* 常用**英文标点符号**和空格\n\n  ```console\n  · , . : ; + - * / \\ ~ ! @ # $ % ^ \u0026 ` ' = \u003c \u003e [ ] ( ) ? _ { } | and  (space)\n  ```\n\n## 环境\n\n- Python 3\n\n## 协议\n\n* GPLv3\n\n## 打赏杯咖啡\n\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/x-hw?logo=github-sponsors\u0026labelColor=pink\u0026color=white)](https://github.com/sponsors#regions)\n\n*GitHub Sponsors 还用不了...*\n\n![wechatpay](https://img.shields.io/badge/-微信打赏-brightgreen?labelColor=brightgreen\u0026logo=data:image/png;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAAAAAAAGa0aABmtGg4ZrRoOGa0aABmtGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmtGgAZrRpGGa0arBmtGkEZrRobGa0aOBmtGkwZrRpNGa0aORmtGhoZrRoDGa0aAAAAAAAAAAAAAAAAAAAAAAAZrRoAGa0aKBmtGucZrRrwGa0a3BmtGvIZrRr6Ga0a+xmtGvMZrRrYGa0alxmtGjcZrRoCGa0aAAAAAAAZrRoAGa0aBhmtGnMZrRr1Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRroGa0adBmtGgkZrRoAGa0aAhmtGnEZrRr2Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGvgZrRp5Ga0aAxmtGkEZrRrmGa0a/xmtGv8ZrRr+Ga0a8RmtGvsZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a6hmtGkkZrRqlGa0a/xmtGv8ZrRr/Ga0a5RmtGkwZrRpzGa0a3hmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRqvGa0a3xmtGv8ZrRr/Ga0a/xmtGpkZrRoDGa0aABmtGicZrRqWGa0a7hmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a5xmtGusZrRr/Ga0a/xmtGu0ZrRo9Ga0aPBmtGmcZrRohGa0aAxmtGj8ZrRq0Ga0a+BmtGv8ZrRr/Ga0a/xmtGvIZrRrQGa0a/xmtGv8ZrRrLGa0agRmtGukZrRr+Ga0a3RmtGosZrRowGa0aEBmtGlsZrRrNGa0a/RmtGv8ZrRrYGa0agxmtGv0ZrRr/Ga0a+hmtGvsZrRr/Ga0a/xmtGv8ZrRr/Ga0a6hmtGqIZrRpDGa0aJRmtGnsZrRrhGa0ajBmtGiAZrRrHGa0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a9BmtGrcZrRpdGa0aOxmtGhoZrRoAGa0aPBmtGtcZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a1BmtGiwZrRoAGa0aABmtGgAZrRowGa0arRmtGvQZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr2Ga0asRmtGjQZrRoAGa0aAAAAAAAZrRoAGa0aABmtGgsZrRpFGa0ajRmtGrsZrRrPGa0azxmtGr0ZrRqQGa0aSBmtGgwZrRoAGa0aAAAAAAAAAAAAAAAAAAAAAAAAAAAAGa0aABmtGgEZrRoKGa0aFBmtGhUZrRoKGa0aARmtGgAAAAAAAAAAAAAAAAAAAAAAz/8AAMAPAADAAwAAgAEAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAMADAADgBwAA+B8AAA==)\n\n\u003cimg src=\"https://github.com/x-hw/amazing-qr/blob/master/example/wechatpay.jpg\" width = \"124\" height = \"116\" alt=\"wechatpay\" align=center /\u003e\n\n![alipay](https://img.shields.io/badge/-支付宝打赏-blue?logo=alipay\u0026logoColor=ffffff\u0026labelColor=blue)\n\n\u003cimg src=\"https://github.com/x-hw/amazing-qr/blob/master/example/alipay.gif\" width = \"132\" height = \"132\" alt=\"alipay\" align=center /\u003e\n\n🎉🎉🎉 感谢你的支持 🎉🎉🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-hw%2Famazing-qr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-hw%2Famazing-qr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-hw%2Famazing-qr/lists"}