Excel Data Import
/install excel-data-import
Excel Data Import
Configuration-driven data import from Excel and CSV files with field mapping, validation, and batch processing.
Prerequisites
- Python 3.8+
- Required:
pip3 install openpyxl pyyaml - Optional:
pip3 install python-calamine(for .xls legacy format)
Quick Start
# import_config.yaml
task_name: "人员信息导入"
source:
file_path: "data/source.xlsx"
sheet_name: "Sheet1"
header_row: 1
key_field: "身份证号"
target:
file_path: "output/result.xlsx"
sheet_name: "人员信息"
header_row: 2
data_start_row: 3
field_mappings:
- source: "姓名"
target: "员工姓名"
required: true
- source: "身份证号"
target: "身份证号码"
required: true
validate: "id_card"
- source: "部门"
target: "所属部门"
default: "待分配"
error_handling:
backup: true
python3 scripts/excel_import.py import_config.yaml
python3 scripts/excel_import.py import_config.yaml --dry-run # preview only
Import Modes
| Mode | Source Config | Use Case |
|---|---|---|
| Single file | source.file_path |
One-to-one import |
| Directory batch | source.type: "directory" |
Process all files in a folder |
| Multi-source | sources: [...] |
Merge from multiple files |
| CSV | .csv file_path |
Auto-encoding detection (UTF-8/GBK/GB2312) |
| Legacy .xls | .xls file_path |
Requires python-calamine |
| Auto header | header_row: "auto" |
Detect header in complex sheets |
For full parameter docs, see data-mapping-guide.md.
Key Features
- Incremental update: Match by
key_field, update existing or append new rows - Multi-layer merged headers: Auto-detect and expand merged cell values
- Validation rollback: Failed rows are skipped entirely (no partial writes)
- Source deduplication: Duplicate keys across files are merged
- Auto-create target: Template generated from field_mappings if missing
Built-in Transforms & Validators
Transforms: strip, upper, lower, title, int, float, date
Validators: required, not_empty, id_card, phone, email, numeric, range, regex, length
For advanced usage, see advanced-features.md.
CLI Options
| Option | Description |
|---|---|
--dry-run |
Preview mode, no file writes |
--verbose |
Detailed per-record output |
--no-backup |
Skip target file backup |
Reference Documents
- Data Mapping Guide: data-mapping-guide.md — field mapping, transforms, validators
- Advanced Features: advanced-features.md — multi-source, batch, auto-header
- Auto Header Detection: auto_header_detection.md — complex header detection
- Quickstart: quickstart.md — step-by-step tutorial
- Workflow: workflow.md — detailed execution flow
- Best Practices: best_practices.md — usage recommendations
- Error Handling: error-handling.md — error codes and recovery
- Troubleshooting: troubleshooting.md — common issues
Workflow
- Read user's import requirements and source/target file info
- Create or adjust YAML config file
- Run
python3 scripts/excel_import.py \x3Cconfig.yaml>with--dry-runfirst - Review output, fix issues, then run without
--dry-run - Check the JSON report alongside the output file
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install excel-data-import - 安装完成后,直接呼叫该 Skill 的名称或使用
/excel-data-import触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Excel Data Import 是什么?
Import, merge, and transform data from Excel (.xlsx/.csv) files using YAML-driven configuration. Use when the user asks to: (1) import data from Excel/CSV in... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 209 次。
如何安装 Excel Data Import?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install excel-data-import」即可一键安装,无需额外配置。
Excel Data Import 是免费的吗?
是的,Excel Data Import 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Excel Data Import 支持哪些平台?
Excel Data Import 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Excel Data Import?
由 sniper-one(@aqbjqtd)开发并维护,当前版本 v2.1.0。