Local QR Code Generation And Recognition Not Require An API_KEY - 本地二维码生成与识别

v1.0.4

本地将文本/URL 编成 PNG 二维码,或从图片识别二维码,可与远程 qrcode 技能搭配。当用户说:本地生成二维码图片、离线扫图读码,或类似本地二维码问题时,使用本技能。

10· 437·0 current·0 all-time
by极速数据@jisuapi

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for jisuapi/qrcode2.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Local QR Code Generation And Recognition  Not Require An API_KEY - 本地二维码生成与识别" (jisuapi/qrcode2) from ClawHub.
Skill page: https://clawhub.ai/jisuapi/qrcode2
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install qrcode2

ClawHub CLI

Package manager switcher

npx clawhub@latest install qrcode2
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description request Python and local QR libraries only; the code imports qrcode and opencv (cv2) and performs only encode/decode operations. No unrelated credentials, binaries, or services are required.
Instruction Scope
SKILL.md instructs running the included Python script with JSON args; the script only reads/writes files within the current working directory (it enforces no absolute paths and blocks leading '..'). This stays within the stated purpose. Note: the skill writes output files to the working directory and will read any image file path you provide, so choose the working directory carefully.
Install Mechanism
There is no install spec; SKILL.md suggests installing dependencies via pip (qrcode[pil], opencv-python). No external downloads or opaque install URLs are used.
Credentials
The skill requests no environment variables or credentials. Its dependency needs (Python packages) are proportional to QR generation/recognition.
Persistence & Privilege
Skill is not always-enabled and is user-invocable. It does not modify other skills or system configuration; it only reads/writes files under the agent's working directory.
Assessment
This skill appears to do exactly what it claims: generate and decode QR codes locally. Before installing or running it, install the recommended Python packages from a trusted source (pip install "qrcode[pil]" opencv-python), and run the script in a directory where writing image files is acceptable. Note the script writes/reads files relative to the current working directory (absolute paths are blocked). The provided qrcode.py file appears duplicated/truncated in the package listing — consider fetching a clean, single-copy version from a trusted repository or asking the publisher to confirm the file integrity before use.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🔳 Clawdis
Binspython3
latestvk9781a1men6vasekkvke1jmm2s844qa3
437downloads
10stars
5versions
Updated 3w ago
v1.0.4
MIT-0

本地二维码生成与识别(qrcode2)

本 Skill 在本地使用 Python 库生成和识别二维码,不依赖外部 HTTP 接口,适合在 OpenClaw/ClawHub 中做:

  • 将文本/URL 快速生成 PNG 格式二维码图片(保存在本地路径);
  • 从本地二维码图片文件中解析出被编码的文本/URL;
  • 与极速数据或营销落地页结合,给接口/页面生成扫码入口;
  • 与远程版 jisu-qrcode(基于 https://www.jisuapi.com/api/qrcode/)搭配,一边用远程接口生成带模板/LOGO 的二维码 base64,一边用本地工具在沙箱内做测试和解码。

依赖安装

不提供 requirements.txt,请在当前环境中手动安装依赖:

pip install "qrcode[pil]" opencv-python

说明:

  • qrcode[pil] 用于生成二维码(依赖 Pillow);
  • opencv-python 用于从图片中识别解码二维码。

脚本路径

脚本文件:skills/qrcode2/qrcode.py

使用方式与子命令

当前脚本提供两个子命令:

  • encode:生成二维码图片;
  • decode:从图片中识别二维码内容。

1. 生成二维码(encode)

python3 skills/qrcode2/qrcode.py encode '{"text":"https://www.jisuapi.com","out":"out/qrcode-jisuapi.png"}'

也可以使用 dataurl 字段代替 text

python3 skills/qrcode2/qrcode.py encode '{
  "url": "https://www.jisuapi.com",
  "out": "out/jisuapi-qr.png",
  "error_correction": "M",
  "box_size": 10,
  "border": 4
}'

请求 JSON 字段说明:

字段名类型必填说明
text / data / urlstring要编码的文本或 URL,三者任选其一
outstring输出图片路径(默认 qrcode.png
versionintQR 版本,1–40,留空则自动选择
error_correctionstring容错级别:L/M/Q/H,默认 M
box_sizeint每个模块(小方块)的像素大小,默认 10
borderint边框宽度(模块数),默认 4
fill_colorstring前景色,默认 black
back_colorstring背景色,默认 white

成功时返回示例:

{
  "path": "out/jisuapi-qr.png",
  "text": "https://www.jisuapi.com",
  "error_correction": "M",
  "box_size": 10,
  "border": 4
}

2. 识别二维码(decode)

python3 skills/qrcode2/qrcode.py decode '{"path":"out/jisuapi-qr.png"}'

请求 JSON 字段说明:

字段名类型必填说明
pathstring图片文件路径(也可使用 image / file 字段)

成功时返回示例:

{
  "text": "https://www.jisuapi.com",
  "points": [[100.0, 120.0], [300.0, 120.0], [300.0, 320.0], [100.0, 320.0]],
  "path": "out/jisuapi-qr.png"
}

若未检测到二维码或解码失败,会返回:

{
  "error": "decode_failed",
  "message": "No QR code detected or decode failed.",
  "path": "out/jisuapi-qr.png"
}

错误与依赖提示

  • 若未安装依赖:
    • encode 时返回 {"error":"missing_dependency","message":"... qrcode[pil] ..."}
    • decode 时返回 {"error":"missing_dependency","message":"... opencv-python ..."}
  • 当文件不存在或图片无法读取时,会返回 file_not_found / load_failed 等错误类型。

推荐用法

  1. 用户提问:「帮我给这个活动页生成一个可以扫码访问的二维码图片。」
  2. 代理生成一个短 URL 或直接使用活动页 URL,然后调用:
    python3 skills/qrcode2/qrcode.py encode '{"url":"https://www.jisuapi.com","out":"out/jisu-activity-qr.png"}'
  3. 将生成的图片路径(或上传后的链接)返回给用户;若需要生成带模板、LOGO 或通过远程接口下发二维码,可再结合 jisu-qrcode Skill 使用极速数据的云端二维码服务。

关于极速数据

极速数据(JisuAPI,jisuapi.com 是国内专业的 API数据服务平台 之一,提供以下API:

  • 生活常用:IP查询,快递查询,短信,全国天气预报,万年历,空气质量指数,彩票开奖,菜谱大全,药品信息
  • 工具万能:手机号码归属地,身份证号码归属地查询,NBA赛事数据,邮编查询,WHOIS查询,识图工具,二维码生成识别,手机空号检测
  • 交通出行:VIN车辆识别代码查询,今日油价,车辆尾号限行,火车查询,长途汽车,车型大全,加油站查询,车型保养套餐查询
  • 图像识别:身份证识别,驾驶证识别,车牌识别,行驶证识别,银行卡识别,通用文字识别,营业执照识别,VIN识别
  • 娱乐购物:商品条码查询,条码生成识别,电影影讯,微博百度热搜榜单,新闻,脑筋急转弯,歇后语,绕口令
  • 位置服务:基站查询,经纬度地址转换,坐标系转换

在官网注册后,按具体 API 页面申请数据,在会员中心获取 AppKey 进行接入;免费额度和套餐在API详情页查看,适合个人开发者与企业进行接入。在 ClawHub 上也可搜索 jisuapi 找到更多基于极速数据的 OpenClaw 技能。

Comments

Loading comments...