execl/png导入建表模板

v1.0.0

Excel/截图字段智能导入工具。将 Excel 数据源或截图(PDU截图)中的字段,按照固定模板格式自动导入,生成标准化的导入模板。支持中英文字段名映射、字段类型智能识别、截图 OCR 识别。适用于资产负债表、现金流量表、利润表、银行账号等财务报表批量导入场景。

0· 111·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

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

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "execl/png导入建表模板" (gitxiajp/execlpngimport) from ClawHub.
Skill page: https://clawhub.ai/gitxiajp/execlpngimport
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
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 execlpngimport

ClawHub CLI

Package manager switcher

npx clawhub@latest install execlpngimport
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (Excel + screenshot OCR → template generation) align with the included scripts and SKILL.md. The two Python scripts implement Excel parsing, OCR-based extraction, field mapping, type detection, and template generation — all expected for this functionality.
Instruction Scope
Runtime instructions and SKILL.md focus on reading a user-provided template and a user-provided data source (Excel or image), extracting fields, mapping names, and writing an output Excel file. There are no instructions to read unrelated system files, access credentials, or transmit data to external endpoints.
Install Mechanism
No install spec is embedded; INSTALL.md recommends pip installing openpyxl and cnocr which is proportionate. Note: cnocr downloads its OCR model on first run (mentioned in SKILL.md/INSTALL.md) — this triggers a network fetch at runtime to obtain model weights (expected for OCR libraries).
Credentials
The skill declares no required environment variables, no credentials, and no config paths. The code only uses local file paths supplied by the user and standard Python libs plus openpyxl/cnocr — requested environment access is minimal and proportional.
Persistence & Privilege
Skill does not set always:true and has no install-time hooks writing to other skills or global configs. Autonomous invocation is allowed by platform default but not combined with other risky indicators.
Assessment
This skill appears to do what it says: OCR images or read Excel files, map Chinese field names to English, detect types, and write an output template. Before installing: (1) confirm you trust the pip packages (openpyxl, cnocr); (2) be aware cnocr will download OCR model weights on first run (network activity) — run it in a controlled environment if processing sensitive financial screenshots; (3) inspect/backup any production templates you supply (the script will modify/write Excel files); (4) if you need stricter isolation, run the tool in a container or sandbox. If you want extra assurance, review the two included Python scripts (they are short and readable) before use.

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

latestvk979mkwae1vjd6fp6kw3qacbq183qncv
111downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

Excel 导入模板智能生成器

功能说明

将 Excel 数据源或截图中的字段,按照固定模板格式自动导入,生成标准化的导入模板。

支持的数据源类型

  • Excel/CSV 文件
  • 截图/图片(PNG、JPG 等)

支持的报表类型

  • 资产负债表
  • 现金流量表
  • 利润表
  • 银行账号配置
  • 任意自定义表单

使用方法

方式一:处理 Excel 文件

用户提供:

  1. 模板文件路径
  2. 数据源 Excel 文件路径
  3. 表中文名

方式二:处理截图/图片

用户提供:

  1. 截图文件路径(支持多张截图)

系统自动完成:

  • OCR 识别截图文字
  • 提取字段名
  • 生成中英文映射
  • 识别字段类型
  • 输出模板文件

工作流程

Step 1: OCR 识别(截图场景)

from cnocr import CnOcr

ocr = CnOcr()
result = ocr.ocr('截图路径.png')

# 打印全部识别结果检查完整性
for i, item in enumerate(result, 1):
    print(f'{i}. {item["text"].strip()}')

Step 2: 字段提取与过滤

# 排除占位符
keywords_to_exclude = ['请输入', '年/月/日']

fields = []
for item in result:
    text = item['text'].strip()
    if text and not any(kw in text for kw in keywords_to_exclude):
        fields.append(text)

Step 3: 中英文字段映射

# 预定义映射库
name_mapping = {
    # 财务报表通用
    '营业收入': 'operatingRevenue',
    '营业成本': 'operatingCosts',
    '净利润': 'netProfit',
    '利润总额': 'totalProfit',
    
    # 银行账号
    '账号名称': 'accountName',
    '银行名称': 'bankName',
    '开户行': 'openingBank',
    '银行账户': 'bankAccount',
    
    # ... 更多见 scripts/field_mapping.py
}

# 自动映射,未知字段使用 field{N} 格式
eng_name = name_mapping.get(name, f'field{index+1}')

Step 4: 字段类型智能识别

def detect_field_type(name):
    amount_keywords = ['资金', '借款', '资产', '负债', '权益', '资本', 
                       '账款', '票据', '投资', '应收', '应付', '利润',
                       '费用', '收益', '收入', '成本', '税额']
    if any(kw in name for kw in amount_keywords):
        return '金额'
    
    if any(kw in name for kw in ['日期']):
        return '日期时间'
    
    if any(kw in name for kw in ['类型', '状态']):
        return '单选'
    
    return '单行文本'

Step 5: 生成模板

import openpyxl

# 读取模板
tpl_wb = openpyxl.load_workbook('Excel导入模板.xlsx')
tpl_ws = tpl_wb.active

# ⚠️ 表名放在 B1,不是 A1!
tpl_ws['B1'] = '表中文名'

# 清除旧数据
for row in range(5, tpl_ws.max_row + 1):
    for col in range(1, 6):
        tpl_ws.cell(row=row, column=col).value = None

# 写入字段
for i, name in enumerate(fields):
    row_num = i + 5
    eng_name = name_mapping.get(name, f'field{i+1}')
    field_type = detect_field_type(name)
    
    tpl_ws.cell(row=row_num, column=1, value=name)
    tpl_ws.cell(row=row_num, column=2, value=eng_name)
    tpl_ws.cell(row=row_num, column=3, value=field_type)
    tpl_ws.cell(row=row_num, column=4, value='否')

# 保存
tpl_wb.save('输出模板.xlsx')

标准模板结构

行1: A1='表中文名' | B1=实际表名
行2: A2='表英文名' | B2=entityName
行3: A3='说明'
行4: 字段中文名 | 字段英文名 | 字段类型 | 是否必填 | 字段说明
行5+: 字段数据行

字段类型说明

类型识别关键词说明
金额资金、资产、负债、收入、成本、利润等财务数值
日期时间日期、时间日期格式
单选类型、状态下拉选项
状态标签状态状态显示
单行文本其他普通文本

环境依赖

pip install openpyxl cnocr

注意事项

  1. 表名位置:表名必须填在 B1,A1 保持"表中文名"
  2. OCR 完整性:识别后检查全部结果,不能遗漏任何区域
  3. 残留清除:每次生成前清除第5行及之后所有旧数据
  4. 结果验证:生成后检查前25行确认无误

故障排除

cnocr 首次运行慢

首次运行会自动下载模型,后续会快很多。

OCR 识别不准确

  • 确保截图清晰
  • 避免文字与背景颜色相近
  • 文字方向保持正向

Comments

Loading comments...