← Back to Skills Marketplace
Household Book Ocr
by
SCNet-sugon
· GitHub ↗
· v1.0.8
· MIT-0
141
Downloads
0
Stars
0
Active Installs
8
Versions
Install in OpenClaw
/install household-book-ocr
Description
将图片中的文字、户口本信息识别并提取出来。本技能应在用户需要 OCR 识别图片中的文字,或识别户口本时使用。
README (SKILL.md)
\r
Sugon-Scnet 户口本识别 OCR 技能\r
\r 本技能封装了户口本识别的 OCR 服务,通过单一接口即可调用 1 种识别能力,高效提取户口本的核心信息。\r \r
功能特性\r
\r
- 个人证照识别:支持识别户口本,自动提取证件核心信息。\r \r \r
前置配置\r
\r
⚠️ 重要:使用前需要申请 Scnet API Token\r \r
申请 API Token\r
\r
- 访问 Scnet 官网 注册/登录\r
- 在控制台申请 API 密钥(格式:
sc-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)\r - 复制密钥备用\r \r
配置 Token\r
\r 手动配置(推荐)\r
- 在技能目录下创建
config/.env文件,内容如下:\r
# ===== Sugon-Scnet OCR API 配置 =====\r
# 申请地址:https://www.scnet.cn\r
SCNET_API_KEY=your_scnet_api_key_here\r
\r
# API 基础地址(一般无需修改)\r
SCNET_API_BASE=https://api.scnet.cn/api/llm/v1\r
```\r
2. 添加:`SCNET_API_KEY=你的密钥`\r
3. 设置文件权限为 600(仅所有者可读写)\r
**⚠️ 安全警告**:切勿将 API Key 直接粘贴到聊天对话中,否则可能被记录或泄露。\r
\r
### Token 更新\r
\r
Token 过期后调用会返回 401 或 403 错误。更新方法:重新申请 Token 并替换 config/.env 中的 SCNET_API_KEY。\r
\r
### 依赖安装\r
\r
本技能需要 Python 3.6+ 和 requests 库。请运行以下命令:\r
\r
```bash\r
pip install requests\r
```\r
---\r
### 使用方法\r
\r
### 参数说明\r
\r
| 参数名 | 类型 | 必填 | 描述 |\r
|--------|------|------|------|\r
| ocrType | string | 是 | 识别类型枚举。必须为以下之一:\x3Cbr>• HOUSEHOLD_REGISTER(户口本) |\r
| filePath | string | 是 | 待识别图片的本地绝对路径。支持 jpg、png、pdf 等常见格式。 |\r
\r
### 命令行调用示例\r
\r
```bash\r
python .claude/skills/household_book_ocr/scripts/main.py HOUSEHOLD_REGISTER /path/to/invoice.jpg\r
```\r
\r
### 在 AI 对话中使用\r
\r
用户可以说:\r
\r
- “帮我识别这张户口本,图片在 /Users/name/Downloads/household.jpg”\r
\r
AI 会根据 description 中的关键词自动触发本技能。\r
\r
### AI 调用建议\r
为避免触发 API 速率限制(10 QPS),请串行调用本技能,即等待前一个识别完成后再发起下一个请求。\r
如果使用 OpenClaw 的 exec 工具,建议设置 timeout 或 yieldMs 参数,让命令同步执行,避免多个命令同时运行导致并发。\r
\r
### 配置选项\r
\r
编辑 `config/.env` 文件:\r
\r
| 变量名 | 默认值 | 说明 |\r
|--------|--------|------|\r
| SCNET_API_KEY | 必需 | Scnet API 密钥 |\r
| SCNET_API_BASE | https://api.scnet.cn/api/llm/v1 | API 基础地址(一般无需修改) |\r
\r
### 输出\r
\r
- 标准输出:识别结果的 JSON 数据,结构与 API 文档一致,位于 `data` 字段内。\r
- 识别结果位于 data[0].result[0].elements 中,具体字段取决于 ocrType。\r
- 错误信息:如果发生错误,会输出以 `错误:` 开头的友好提示。\r
\r
### 注意事项\r
\r
- 本技能调用的 OCR API 有 10 QPS 的速率限制。\r
- 如果遇到 429 错误,请等待 2-3 秒后重试,不要连续发起请求。\r
- 建议在调用前确保图片已准备就绪,避免因网络问题导致重复调用。\r
\r
### 故障排除\r
\r
| 问题 | 解决方案 |\r
|------|----------|\r
| 配置文件不存在 | 创建 config/.env 并填入 Token(参考前置配置) |\r
| API Key 无效/过期 | 重新申请 Token 并更新 `.env` 文件 |\r
| 文件不存在 | 检查提供的文件路径是否正确 |\r
| 网络连接失败 | 检查网络连接或防火墙设置 |\r
| 不支持的文件类型 | 确保文件扩展名为允许的类型(参考 API 文档) |\r
| 401/403/Unauthorized | Token 无效或过期,重新申请并配置 |\r
| 429 Too Many Requests | 请求过于频繁,技能会自动等待并重试(最多 3 次)。若持续失败,请降低调用频率或联系服务方提高限额。 |\r
\r
\r
Usage Guidance
This skill appears to be what it says: it uploads a local image to Scnet's OCR API and returns structured fields (suitable for household-register documents). Before installing or running it, consider: 1) Metadata mismatch — the package registry omitted required env vars; make sure you supply SCNET_API_KEY via a secure environment variable or a config/.env file with permissions set to 600. 2) Privacy: images of household registers contain highly sensitive personal data (names, ID numbers, addresses); using this skill sends those images to a third‑party service (api.scnet.cn). Review Scnet's privacy policy and ensure you trust the service before sending real documents. 3) Security: keep the API key secret (do not paste it into chat), and consider testing with non-sensitive images first. 4) If you need the registry metadata fixed (so the required credential is declared), contact the skill author or maintainers before wide deployment.
Capability Tags
Capability Assessment
Purpose & Capability
The skill's name/description (household register OCR) matches its code and runtime instructions: the script posts an image to Scnet's OCR endpoint and returns parsed JSON. However, registry metadata claims 'Required env vars: none' while SKILL.md and scripts/main.py clearly require SCNET_API_KEY (and optionally SCNET_API_BASE). This is an inconsistency in declared metadata but not evidence of malicious intent.
Instruction Scope
SKILL.md and scripts/main.py limit actions to reading a configured API key (from config/.env or environment), reading the user-supplied image file, and uploading it to https://api.scnet.cn/api/llm/v1/ocr/recognize. There are no instructions to read unrelated system files, other credentials, or exfiltrate data to unexpected endpoints.
Install Mechanism
There is no install spec (instruction-only skill with an included Python script). The code uses only the requests library and standard Python features. No remote downloads or extract/install steps are performed by the skill itself.
Credentials
The code requires a single API credential (SCNET_API_KEY) and an optional SCNET_API_BASE — which is proportionate for a hosted OCR API. The concern is a documentation/metadata mismatch: the registry metadata did not declare required env vars or a primary credential even though SKILL.md and the script require SCNET_API_KEY. That omission could cause users to overlook the need to provide a secret.
Persistence & Privilege
The skill does not request persistent inclusion (always: false), does not modify other skills or system-wide settings, and does not create background services. It only reads a local config/.env and the provided image file at runtime.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install household-book-ocr - After installation, invoke the skill by name or use
/household-book-ocr - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.8
household_book_ocr 1.0.8
- Version bump to 1.0.8 with no code changes detected.
- No changes to functionality, configuration, or interface.
- All usage, input/output, and documentation remain the same as previous version.
v1.0.7
- 新增 SCNET_API_BASE 为必填环境变量,提高环境配置的明确性
- 版本号更新为 1.0.7
v1.0.6
- 增加了 required_env_vars、optional_env_vars 和 primary_credential 字段,明确环境变量要求。
- 无功能变更,仅对 SKILL.md 配置项进行了完善和标准化。
- 版本号更新为 1.0.6。
v1.0.5
household-book-ocr 1.0.5
- Version bump only; no file or functionality changes detected.
- Maintains existing OCR features and configuration guides.
v1.0.4
- 修正了描述和用法示例,仅限于户口本识别,去除身份证、发票等误导性用例
- 精简“在 AI 对话中使用”的例句,更准确地反映技能的实际用途
- 移除 SKILL.md 中无关的 required_env_vars 和 optional_env_vars 字段,提高文档准确性
- 版本号从 1.0.3 升级到 1.0.4
v1.0.3
household-book-ocr 1.0.3
- 增加 skill.yaml 文件以提升技能描述和配置的结构化支持。
- SKILL.md 增补依赖、环境变量说明,明确须安装 Python 和 requests。
- 更新配置指引,强调仅使用手动配置,增加安全警告(不要将 API Key 粘贴至对话中)。
- 明确 required/optional 环境变量、主要凭证字段和依赖。
- 小幅调整前置配置内容和格式。
v1.0.1
household-book-ocr 1.0.1
- No code or documentation changes detected.
- Version bump only; behavior and features remain unchanged.
v0.1.0
Initial release of household_book_ocr:
- Provides OCR recognition for images and household registration documents, with structured JSON output including confidence scores.
- Supports input parameters for recognition type (ocrType) and image file path (filePath).
- Requires configuration of Scnet API Token via .env file.
- Includes rate limiting management (10 QPS) and user-friendly error handling.
- Offers command-line and conversational usage examples for easy integration and troubleshooting.
Metadata
Frequently Asked Questions
What is Household Book Ocr?
将图片中的文字、户口本信息识别并提取出来。本技能应在用户需要 OCR 识别图片中的文字,或识别户口本时使用。 It is an AI Agent Skill for Claude Code / OpenClaw, with 141 downloads so far.
How do I install Household Book Ocr?
Run "/install household-book-ocr" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Household Book Ocr free?
Yes, Household Book Ocr is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Household Book Ocr support?
Household Book Ocr is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Household Book Ocr?
It is built and maintained by SCNet-sugon (@scnet-sugon); the current version is v1.0.8.
More Skills