Office Generator Py

👤 lujohn74 📦 v1.0.0 ⭐ 4.3 ⬇️ 1.4K 下载
📄 办公效率 免费

📖 技能介绍


name: office-generator-py description: Generate Office files with a bundled Python engine. Use when creating or exporting Word (.docx), Excel (.xlsx), or PowerPoint (.pptx) files from structured JSON, reports, meeting minutes, project plans, trackers, business briefs, or natural-language requirements that must be turned into Office documents.


Office Generator Py

Generate Office files with the bundled engine under scripts/engine/.

First run

Install Python dependencies into the bundled virtualenv:

python3 skills/office-generator-py/scripts/setup_engine.py

If you manage the environment yourself, you can point the wrapper at another Python binary with OFFICE_GENERATOR_PYTHON=/path/to/python.

Quick workflow

  1. Decide the output type: docx, xlsx, or pptx.
  2. Prefer a built-in business template when it fits.
  3. Write a UTF-8 JSON request file.
  4. Run scripts/generate_office.py.
  5. Return the produced file path.

Entrypoints

Use scripts/generate_office.py.

7w4.net小葱技能站收录全网优质技能,值得收藏。

  • Standard mode: pass --type with a full JSON request file.
  • Business mode: pass --kind, --title, --input, and --out.

Built-in templates

Word

  • word_work_report_v1
  • meeting_minutes_v1

Excel

  • excel_data_tracker_v1
  • project_plan_v1

PPT

  • ppt_business_brief_v1
  • project_status_brief_v1

Built-in business kinds

  • word-report
  • meeting-minutes
  • excel-tracker
  • project-plan
  • ppt-brief
  • project-status-brief

Commands

Standard mode:

python3 skills/office-generator-py/scripts/generate_office.py \
  --type docx \
  --input /absolute/path/request.json \
  --out /absolute/path/output.docx

Business mode:

python3 skills/office-generator-py/scripts/generate_office.py \
  --kind meeting-minutes \
  --title "Office 评审会纪要" \
  --purpose "内部存档" \
  --input /absolute/path/content.json \
  --out /absolute/path/meeting_minutes.docx

Request shaping

If the user gives natural language only, convert it into JSON first.

For supported request formats and sample payloads, read references/input-formats.md.

Output contract

  • Success: stdout prints the generated file path.
  • Failure: stderr prints the error; command exits non-zero.

Notes

  • Keep output paths absolute when possible.
  • Prefer business mode for common document types.
  • Use standard mode when the caller already has full documentType/templateId/contentSpec JSON.

🤖 AI 评测

质量中规中矩,能正常生成 Word、Excel、PPT 三种文件。优点是操作简单、有现成模板可用、错误提示清晰;缺点是模板数量少、文档说明不够详细、缺少示例文件参考。对于日常简单文档需求基本够用,但复杂场景可能需要自行调整配置。整体属于可用但不够完善的工具。

📊 多维度评分

适应性4.5
规范性4.1
有效性4.4
可靠性4.2
可信度4.8

📁 包含文件 (21 个)

📄 SKILL.md 2.4 KB
📄 _meta.json 138 B
📄 references/input-formats.md 2.2 KB
📄 scripts/engine/business_cli.py 2.3 KB
📄 scripts/engine/generators/__init__.py 21 B
📄 scripts/engine/generators/docx_generator.py 1.9 KB
📄 scripts/engine/generators/pptx_generator.py 4.2 KB
📄 scripts/engine/generators/xlsx_generator.py 1.5 KB
📄 scripts/engine/main.py 2 KB
📄 scripts/engine/requirements.txt 61 B
📄 scripts/engine/schemas/__init__.py 18 B
📄 scripts/engine/schemas/common_schema.py 2 KB
📄 scripts/engine/template_loader.py 1.2 KB
📄 scripts/engine/templates/docx/meeting_minutes_v1.json 552 B
📄 scripts/engine/templates/docx/word_work_report_v1.json 535 B
📄 scripts/engine/templates/pptx/ppt_business_brief_v1.json 465 B
📄 scripts/engine/templates/pptx/project_status_brief_v1.json 556 B
📄 scripts/engine/templates/xlsx/excel_data_tracker_v1.json 331 B
📄 scripts/engine/templates/xlsx/project_plan_v1.json 363 B
📄 scripts/generate_office.py 2.1 KB
📄 scripts/setup_engine.py 854 B