← Back to Skills Marketplace
Bank Card Ocr
by
SCNet-sugon
· GitHub ↗
· v1.0.6
· MIT-0
185
Downloads
0
Stars
0
Active Installs
6
Versions
Install in OpenClaw
/install bank-card-ocr
Description
支持识别中国大陆银行卡,提取卡号、持卡人姓名(拼音/中文)、有效期及发卡行信息.
README (SKILL.md)
\r
Sugon-Scnet 银行卡识别 OCR 技能\r
\r 本技能封装了 Sugon-Scnet 银行卡识别 OCR 服务,通过单一接口即可调用 1 种识别能力,高效提取文字及票据信息。\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>• BANK_CARD(银行卡) |\r
| filePath | string | 是 | 待识别图片的本地绝对路径。支持 jpg、png、pdf 等常见格式。 |\r
\r
### 命令行调用示例\r
\r
```bash\r
python .claude/skills/bank_card_ocr/scripts/main.py BANK_CARD /path/to/invoice.jpg\r
```\r
\r
### 在 AI 对话中使用\r
\r
用户可以说:\r
\r
- “帮我识别这张银行卡,图片在 /Users/name/Downloads/id.jpg”\r
\r
AI 会根据 description 中的关键词自动触发本技能。\r
\r
## ⚠️ 安全与隐私警告\r
\r
- **银行卡图像包含敏感信息**(卡号、持卡人姓名等),使用本技能会将该图像上传至 `https://api.scnet.cn` 进行 OCR 识别。\r
- 请确保你已阅读并同意 [Scnet 隐私政策],并确认该行为符合你的合规要求。\r
- **不要在生产环境中使用真实银行卡图像**,除非你完全信任 Scnet 服务且数据加密传输得到保障。\r
- 建议使用测试卡号或非敏感图像先行验证。\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 will upload any image path you give it to Scnet's OCR API, so only use it with images you are comfortable sending to that external service. Before installing: confirm you trust the Scnet domain (https://api.scnet.cn) and the vendor's privacy practices; avoid using real bank cards in production—use test data; store the SCNET_API_KEY securely (config/.env with 600 perms or an environment variable) and never paste the key in chat; rotate the API key if it may be exposed. If you need stronger assurance, verify the upstream repository/homepage and review TLS/ownership of scnet.cn. The package itself contains no unrelated credential access or hidden endpoints.
Capability Analysis
Type: OpenClaw Skill
Name: bank-card-ocr
Version: 1.0.6
The skill is a legitimate implementation of a bank card OCR tool that interfaces with the Scnet API (api.scnet.cn). The Python script (scripts/main.py) correctly handles file uploads, implements retry logic for rate limiting, and manages credentials through environment variables or a local configuration file. The documentation (SKILL.md) includes explicit privacy warnings regarding the sensitivity of bank card data and lacks any malicious prompt injection attempts or unauthorized data exfiltration logic.
Capability Tags
Capability Assessment
Purpose & Capability
Name/description (bank card OCR) match the implementation: the script posts a local image file to https://api.scnet.cn/api/llm/v1/ocr/recognize and extracts fields such as cardNumber, cardHolder and validThru. The single required env var (SCNET_API_KEY) is the expected credential for the remote OCR service.
Instruction Scope
Runtime instructions and the script require access to a user-provided local file path and will upload that image to the Scnet API — this is expected for OCR but implies transmission of sensitive data (card numbers, names). The SKILL.md explicitly warns about this. The skill does not attempt to read other system files or unrelated environment variables.
Install Mechanism
This is instruction-only with a small Python script and no install spec that downloads external code. Dependencies are limited to Python and the requests library; nothing is pulled from untrusted URLs during install.
Credentials
Only SCNET_API_KEY (and optional SCNET_API_BASE) are required. No unrelated credentials, high-privilege tokens, or config paths are requested. The script reads a local config/.env if present or recommends setting an environment variable; that is consistent with the declared requirements.
Persistence & Privilege
The skill is not always-enabled and does not modify other skills or system-wide settings. It runs on-demand and does not request persistent elevated privileges.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install bank-card-ocr - After installation, invoke the skill by name or use
/bank-card-ocr - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.6
- 明确了 SCNET_API_BASE 环境变量为可选项,提升配置灵活性。
- 优化示例对话内容,将“身份证”改为“银行卡”,更贴合技能用途。
- 新增专门的安全与隐私警告,提醒用户银行卡数据上传和合规风险。
- 技能版本更新至 1.0.6。
v1.0.5
- 修正命令行调用示例的路径至 scripts/bank_card_ocr 目录,反映技能名变更。
- 版本号由 1.0.4 更新为 1.0.5。
- 其余功能和配置说明保持不变。
v1.0.4
- 文档更正:将“单一接口即可调用 10 种识别能力”修订为实际仅支持 1 种(银行卡识别)。
- 其余功能、接口参数和配置未变。
v1.0.3
Version 1.0.3 of bank-card-ocr skill
- Added skill.yaml metadata file.
- SKILL.md updated with explicit environment variable requirements, dependency list, and security notes.
- Improved configuration instructions, including manual setup and file permission advice.
- Added detailed QPS/concurrency limitation advice and instructions for handling API rate limits.
- Clarified support scope: focused on China mainland bank card OCR.
- Usage examples and troubleshooting sections improved for clarity and completeness.
v1.0.1
- Removed the sample config.json file from the skill.
- No functional changes; configuration guidance remains in SKILL.md.
v0.1.0
Initial release of bank-card-ocr skill.
- Supports OCR recognition for Mainland China bank cards, extracting card number, cardholder name (Pinyin/Chinese), validity period, and issuing bank information.
- Provides structured JSON output with recognition results and confidence scores.
- Requires configuration of a Scnet API Token for usage.
- Supports common image formats (jpg, png, pdf) via local file paths.
- Includes command-line and AI dialogue invocation methods.
- Offers detailed error handling and troubleshooting guidance.
Metadata
Frequently Asked Questions
What is Bank Card Ocr?
支持识别中国大陆银行卡,提取卡号、持卡人姓名(拼音/中文)、有效期及发卡行信息. It is an AI Agent Skill for Claude Code / OpenClaw, with 185 downloads so far.
How do I install Bank Card Ocr?
Run "/install bank-card-ocr" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Bank Card Ocr free?
Yes, Bank Card Ocr is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Bank Card Ocr support?
Bank Card Ocr is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Bank Card Ocr?
It is built and maintained by SCNet-sugon (@scnet-sugon); the current version is v1.0.6.
More Skills