{
  "markdown": "# 📊 Office Automation Skill for OpenClaw\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![OpenClaw](https://img.shields.io/badge/OpenClaw-Skill-orange)](https://clawhub.ai)\n\n> 自动化处理 Word 和 Excel 文件的 OpenClaw 技能  \n> Automate Word and Excel document processing with OpenClaw\n\n[English](#english) | [中文](#中文)\n\n---\n\n## 🌟 功能特点 / Features\n\n- 📄 **Word 处理** - 读取、写入、模板填充、表格提取\n- 📊 **Excel 处理** - 读取、写入、合并、转换、数据分析\n- 🔄 **批量处理** - 批量生成文档、格式转换、数据提取\n- 🤖 **AI 集成** - 与 OpenClaw 无缝集成，支持自然语言命令\n\n---\n\n## 🚀 快速开始 / Quick Start\n\n### 安装依赖 / Install Dependencies\n\n```bash\npip install python-docx openpyxl pandas\n```\n\n### 测试脚本 / Test Scripts\n\n```bash\n# Word 测试 / Word Test\npython scripts/word_processor.py write test.docx --content \"Hello World\" --title \"Test\"\n\n# Excel 测试 / Excel Test\npython scripts/excel_processor.py write test.xlsx --data '[[\"Name\",\"Age\"],[\"Alice\",25]]' --headers \"Name,Age\"\n```\n\n---\n\n## 📖 文档 / Documentation\n\n| 文档 | 说明 |\n|------|------|\n| [使用指南](docs/使用指南.md) | 完整的使用教程和命令参考 |\n| [示例集合](docs/示例集合.md) | 实战案例和代码示例 |\n| [API 参考](references/office_api.md) | Python API 详细文档 |\n\n---\n\n## 💡 使用示例 / Usage Examples\n\n### Word 模板填充\n\n```bash\npython scripts/word_processor.py template contract.docx \\\n  --output contract_filled.docx \\\n  --data '{\"name\":\"张三\",\"date\":\"2026-02-22\"}'\n```\n\n### Excel 数据合并\n\n```bash\npython scripts/excel_processor.py merge ./reports/ --output all.xlsx\n```\n\n### 批量生成文档\n\n```bash\npython scripts/batch_processor.py templates \\\n  --folder ./output \\\n  --template invitation.docx \\\n  --data attendees.json\n```\n\n---\n\n## 📁 项目结构 / Project Structure\n\n```\noffice-automation/\n├── SKILL.md                    # OpenClaw 技能定义\n├── README.md                   # 本文件\n├── LICENSE                     # MIT 许可证\n├── .gitignore                  # Git 忽略文件\n├── scripts/\n│   ├── word_processor.py       # Word 处理脚本\n│   ├── excel_processor.py      # Excel 处理脚本\n│   └── batch_processor.py      # 批量处理脚本\n├── references/\n│   └── office_api.md           # API 参考文档\n├── docs/\n│   ├── 使用指南.md             # 使用教程\n│   └── 示例集合.md             # 示例代码\n└── examples/\n    └── sample_data.json        # 示例数据\n```\n\n---\n\n## 🔧 脚本命令 / Script Commands\n\n### word_processor.py\n\n| 命令 | 说明 |\n|------|------|\n| `read <file>` | 读取文档内容 |\n| `write <output> --content \"文本\"` | 创建新文档 |\n| `template <文件> --output <输出> --data 'JSON'` | 填充模板 |\n| `extract <文件> --table 0` | 提取表格到 CSV |\n\n### excel_processor.py\n\n| 命令 | 说明 |\n|------|------|\n| `read <file> --sheet Sheet1` | 读取 Excel |\n| `write <output> --data 'JSON'` | 写入数据 |\n| `merge <文件夹> --output <输出>` | 合并文件 |\n| `convert <文件> --to csv/xlsx` | 格式转换 |\n| `analyze <文件>` | 数据分析 |\n\n### batch_processor.py\n\n| 命令 | 说明 |\n|------|------|\n| `templates --folder --template --data` | 批量填充模板 |\n| `convert --folder --from --to --output` | 批量转换格式 |\n| `extract --folder --output` | 批量提取表格 |\n\n---\n\n## 🎯 实战案例 / Use Cases\n\n### 1. 批量生成合同 / Batch Generate Contracts\n\n```bash\npython scripts/batch_processor.py templates \\\n  --folder ./contracts \\\n  --template contract_template.docx \\\n  --data clients.json\n```\n\n### 2. 月度报告合并 / Merge Monthly Reports\n\n```bash\npython scripts/excel_processor.py merge ./monthly_reports/ \\\n  --output yearly_report.xlsx\n```\n\n### 3. 数据提取与分析 / Extract and Analyze Data\n\n```bash\n# 提取 Word 表格\npython scripts/word_processor.py extract report.docx\n\n# 分析 Excel 数据\npython scripts/excel_processor.py analyze sales.xlsx\n```\n\n---\n\n## ⚠️ 注意事项 / Notes\n\n1. **Word 格式** - 仅支持 .docx（不支持旧版 .doc）\n2. **Excel 格式** - 支持 .xlsx 和 .xlsm\n3. **编码** - CSV 文件使用 UTF-8-BOM 编码\n4. **大文件** - 超过 100MB 建议分批次处理\n\n---\n\n## 🤝 与 OpenClaw 集成 / OpenClaw Integration\n\n在 OpenClaw 聊天中直接使用：\n\n```\n请帮我读取 document.docx 的内容\n从 data.xlsx 提取销售数据\n批量生成 100 份合同，数据在 data.json 中\n```\n\n---\n\n## 📄 许可证 / License\n\n本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。\n\n---\n\n## 🙏 致谢 / Acknowledgments\n\n- [OpenClaw](https://clawhub.ai) - AI 代理网关框架\n- [python-docx](https://python-docx.readthedocs.io/) - Word 处理库\n- [openpyxl](https://openpyxl.readthedocs.io/) - Excel 处理库\n- [pandas](https://pandas.pydata.org/) - 数据分析库\n\n---\n\n## 📮 联系方式 / Contact\n\n- 🐛 问题反馈：GitHub Issues\n- 💬 社区讨论：OpenClaw Discord\n- 📚 更多技能：[ClawHub](https://clawhub.ai)\n\n---\n\n<div align=\"center\">\n\n**Made with ❤️ for OpenClaw Community**\n\n[⬆ 返回顶部](#-office-automation-skill-for-openclaw)\n\n</div>\n",
  "bytes": 4386,
  "sha": "32ac7fba8df7aeaeeab9c37faac4f2e4827804d2c4768d183182d7a2edabdd27",
  "repo_slug": "texiaoyao/office-automation-skill",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/skl_texiaoyao_office_automation_skill_office_a7d6a693/readme"
}