
Office Automation
Handles Word and Excel files through Python scripts using python-docx, openpyxl, and pandas. You get CLI tools for reading documents, filling templates with variable substitution, extracting tables to CSV, merging multiple Excel files, and converting between formats. The template system uses simple {{variable}} syntax with JSON data input. It's built for batch operations like generating contracts or consolidating spreadsheets, though you're limited to modern formats only (docx and xlsx, no legacy doc files). The scripts live in a skills directory and expect UTF-8 encoding. If you're already comfortable with these libraries, this is just a wrapper with predefined commands, but it saves setup time for common office automation tasks.
- skills.sh installs
- 3K
- GitHub stars
- 7
- last updated
- Jul 14, 2026
Install
$ npx -y skills add texiaoyao/office-automation-skill --skill office-automation --agent claude-codeInstalls into .claude/skills of the current project.
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 | 提取表格到 CSV | extract file.docx --table 1 |
format | 格式化文档 | format file.docx --style heading |
excel_processor.py
Sponsors
Details
- Repository
- github.com/texiaoyao/office-automation-skill
- Categories
- Automation & Workflows, Office & Documents