Python scripts that read, write, template, and convert Word and Excel files in batch.

CCM score
30 of 100
skills.sh installs
3K
GitHub stars
8
last updated
Jul 14, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers Word (.docx) commands read, write, template, extract, and format, plus Excel commands read, write, merge, convert, and analyze
  • Ships two scripts, word_processor.py and excel_processor.py, that fill {{variables}} in templates and export tables to CSV
  • Supports .docx, .xlsx, and .xlsm only; legacy .doc files are not handled and files over 100MB should be split
  • Requires python-docx, openpyxl, and pandas, and is intended for report generation, template filling, and spreadsheet consolidation

Install

$ npx -y skills add texiaoyao/office-automation-skill --skill office-automation -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Office 自动化技能

使用 Python 脚本自动化处理 Word (.docx) 和 Excel (.xlsx/xlsm) 文件。

快速开始

1. 安装依赖

pip install python-docx openpyxl pandas

2. 基本用法

处理 Word 文档:

python scripts/word_processor.py read document.docx
python scripts/word_processor.py write output.docx --content "Hello World"
python scripts/word_processor.py template fill.docx --data '{"name": "张三", "date": "2026-02-22"}'

处理 Excel 表格:

python scripts/excel_processor.py read data.xlsx
python scripts/excel_processor.py write output.xlsx --sheet "Sheet1"
python scripts/excel_processor.py merge folder/ --output merged.xlsx

脚本说明

word_processor.py

命令说明示例
read读取 Word 文档内容read file.docx
write创建新文档write out.docx --content "文本"
template填充模板(替换 {{变量}})template doc.docx --data '{"key": "value"}'
extract提取表格到 CSVextract file.docx --table 1
format格式化文档format file.docx --style heading

excel_processor.py

Details

Repository
github.com/texiaoyao/office-automation-skill
Categories
Office Files & Slides, Workflow Automation

Similar to Office Automation

More Office Files & Slides