excel_diff
/excel_diff
比对两份 Excel 表格的差异,按位置或按主键找出修改、新增、删除的行,可导出差异表。当用户提到对比 Excel、Excel 差异、两份表格有什么不同、核对表格时使用。
- Author
- coderwanfeng ↗
- Repository
- python-office ↗
- Licence
- Apache-2.0
- Last repository change
- 26.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: __init__.py
What it does and when to use it
比对两份 Excel 表格的差异,按位置或按主键找出修改、新增、删除的行,可导出差异表。当用户提到对比 Excel、Excel 差异、两份表格有什么不同、核对表格时使用。
Original author description
比对两份 Excel 表格的差异,按位置或按主键找出修改、新增、删除的行,可导出差异表。当用户提到对比 Excel、Excel 差异、两份表格有什么不同、核对表格时使用。
How it works
- 功能描述
- 所属分类
- 调用方式
- 参数说明
- 返回值
- 使用示例
- 原始函数
SKILL.md preview
---
name: excel_diff
description: 比对两份 Excel 表格的差异,按位置或按主键找出修改、新增、删除的行,可导出差异表。当用户提到对比 Excel、Excel 差异、两份表格有什么不同、核对表格时使用。
---
# excel_diff Skill
> 比对两份 Excel,输出单元格级差异,可导出差异表
## 功能描述
把两份 Excel 的同一张工作表做对比,返回每个变化的单元格、新增行、删除行和表头变化。
支持两种模式:按行号逐格比对(适合行顺序固定的表),或按主键配对后再比对
(适合行顺序会变、但每行有唯一编号的表)。
## 所属分类
`skills/excel/excel_diff/`
## 调用方式
```python
from skills.excel import excel_diff
excel_diff(
before_path='上周报表.xlsx',
after_path='本周报表.xlsx',
key_column='订单号',
)
```
## 参数说明
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| `before_path` | str | 是 | - | 变更前的 Excel 路径 |
| `after_path` | str | 是 | - | 变更后的 Excel 路径 |
| `sheet_name` | str | 否 | `None` | 工作表名,默认取第一个 |
| `key_column` | str | 否 | `None` | 主键列名;指定后按主键配对行 |
| `ignore_case` | bool | 否 | `False` | 文本比较是否忽略大小写 |
| `output_path` | str | 否 | `None` | 差异表输出路径,指定后写出 .xlsx |
## 返回值
`dict`,包含 `mode`、`sheet`、`header`、`summary`、`changes`、`added_rows`、
`removed_rows`、`output_path` 八个键。`summary` 中的 `identical` 表示两份表是否完全一致。
## 使用示例
```python
from skills.excel import excel_diff
result = excel_diff('v1.xlsx', 'v2.xlsx', key_column='编号', output_path='差异.xlsx')
print(result['summary'])
for item in result['changes']:
print(item['key'], item['column'], item['before'], '->', item['after'])
```
## 原始函数
`contributors/my12yyds/excel_diff.py`
Files in this package (2)
- SKILL.md 2 KB
- __init__.py 1 KB
Versions
The database has no other skills named excel_diff.
Database snapshot: 13.11.2026 · package version 3a1f856b7198 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95Xlsx
Excel file processing. USE WHEN xlsx, Excel, spreadsheet. SkillSearch('xlsx') for docs. - 95Xlsx
Excel file processing. USE WHEN xlsx, Excel, spreadsheet. SkillSearch('xlsx') for docs. - 90batch_rename_by_excel
按 Excel 中记录的新旧文件名映射批量重命名文件。当用户提到按表格/清单批量改名、按 Excel 对照表重命名文件、批量修改文件名但改名规则已列在表格里时使用。 - 93excel-link
读取、统计、修改和新建 Excel/WPS 表格(.xlsx、.xlsm、.xls、.csv)。用户要整理或汇总工程数据、做计算表、按公式计算、统计分析、画曲线图或柱状图,或在已有表格中填数、改公式时,都使用本技能,即使用户没有提到 Excel。 - 86excel_dedupe
按指定列或整行给 Excel 去重,返回重复行与保留行的对应关系,可导出干净数据。当用户提到 Excel 去重、删除重复项、重复数据、查重时使用。 - 100excel-macro-creator
Create excel macro creator operations. Auto-activating skill for Business Automation. Triggers on: excel macro creator, excel macro creator Part of the Business Automation skill category. Use when working with excel macro creator functionality. Trigger with phrases like "excel…