Xpersona
L

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

CLAWHUB · Unverified

本地将文本/URL 编成 PNG 二维码,或从图片识别二维码,可与远程 qrcode 技能搭配。当用户说:本地生成二维码图片、离线扫图读码,或类似本地二维码问题时,使用本技能。 Skill: Local QR Code Generation And Recognition Not Require An API_KEY - 本地二维码生成与识别 Owner: jisuapi Summary: 本地将文本/URL 编成 PNG 二维码,或从图片识别二维码,可与远程 qrcode 技能搭配。当用户说:本地生成二维码图片、离线扫图读码,或类似本地二维码问题时,使用本技能。 Tags: latest:1.0.4 Version history: v1.0.4 | 2026-04-03T09:21:40.453Z | user No user-facing changes detected. - No file changes or feature updates in this version. - Documentation and functionality remain as in the previous

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s174fh1b14sn7vkvbqwsdn0xtd83gz5h:qrcode2
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jisuapi-qrcode2/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

21,295 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: "Local QR Code Generation And Recognition  Not Require An API_KEY - 本地二维码生成与识别"
description: 本地将文本/URL 编成 PNG 二维码,或从图片识别二维码,可与远程 qrcode 技能搭配。当用户说:本地生成二维码图片、离线扫图读码,或类似本地二维码问题时,使用本技能。
metadata: { "openclaw": { "emoji": "🔳", "requires": { "bins": ["python3"], "env": [] } } }
---

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

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

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

## 依赖安装

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

```bash
pip install "qrcode[pil]" opencv-python
```

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

## 脚本路径

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

## 使用方式与子命令

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

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

### 1. 生成二维码(encode)

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

也可以使用 `data` 或 `url` 字段代替 `text`:

```bash
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 / url| string | 是   | 要编码的文本或 URL,三者任选其一 |
| out              | string | 否   | 输出图片路径(默认 `qrcode.png`) |
| version          | int    | 否   | QR 版本,1–40,留空则自动选择 |
| error_correction | string | 否   | 容错级别:`L/M/Q/H`,默认 `M` |
| box_size         | int    | 否   | 每个模块(小方块)的像素大小,默认 `10` |
| border           | int    | 否   | 边框宽度(模块数),默认 `4` |
| fill_color       | string | 否   | 前景色,默认 `black` |
| back_color       | string | 否   | 背景色,默认 `white` |

成功时返回示例:

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

### 2. 识别二维码(decode)

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

请求 JSON 字段说明:

| 字段名 | 类型   | 必填 | 说明 |
|--------|--------|------|------|
| path   | string | 是   | 图片文件路径(也可使用 `image` / `file` 字段) |

成功时返回示例:

```json
{
  "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"
}
```

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

```json
{
  "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. 代理生成

_meta.json

{
  "ownerId": "kn7ex9mabfb47dvpgkmeypwqj9825yyz",
  "slug": "qrcode2",
  "version": "1.0.4",
  "publishedAt": 1775208100453
}

skill-card.md

## Description:

This skill locally encodes text or URLs into PNG QR codes and decodes QR code contents from image files without requiring an external API key.

This skill is ready for commercial/non-commercial use.

## Publisher:

[jisuapi](https://clawhub.ai/user/jisuapi)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agents use this skill to create local PNG QR codes from text or URLs and decode QR code contents from local images without calling an external API.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Local path handling and input limits can let the skill read or overwrite more than users expect.

Mitigation: Install it in a contained environment, use a dedicated output directory, avoid untrusted paths or symlinked workspaces, and avoid very large QR rendering parameters until the security guidance is resolved.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/jisuapi/skills/qrcode2)
- [JisuAPI QR code API reference](https://www.jisuapi.com/api/qrcode/)

## Skill Output:

**Output Type(s):** [text, shell commands, files, guidance]

**Output Format:** [JSON command responses with local PNG image files for encoded QR codes]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires python3 plus the qrcode[pil] package for encoding and opencv-python for decoding.]

## Skill Version(s):

1.0.4 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Local QR Code Generation And Recognition Not Require An API_KEY - 本地二维码生成与识别 and adjacent AI workflows.