PPT生成器

Dynatrace品牌的可重用PPTX生成器,支持通过CLI、Python库和MCP工具服务器(适用于GitHub Copilot、VS Code、Claude Desktop)生成精美的幻灯片。

  • by pushpendrasinghbaghel-ai
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 pushpendrasinghbaghel-ai/dt-ppt-builder

使用说明

dt ppt构建器

可重复使用的Dynatrace品牌PPTX发电机——可作为 命令行界面, Python库,以及 MCP工具服务器 GitHub Copilot/VS Code/Claude Desktop。

插入客户配置+需求JSON→ 拿出一个擦亮的滑梯。


快速启动(CLI)

# 1. Install dependencies
pip install -r requirements.txt

# 2. Build a deck
py build_deck.py --config configs/example/config.yaml

# 3. Optional: override output path on the fly
py build_deck.py --config configs/example/config.yaml --output C:\temp\test.pptx

MCP服务器(GitHub副本/VS代码/Claude桌面)

MCP服务器将PPT生成器作为任何兼容MCP的AI客户端的工具公开 可以打电话。您的同事可以在Copilot Chat和该工具中键入自然语言 自动生成品牌牌组。

设置

1.安装依赖项:

cd dt-ppt-builder
pip install -r requirements.txt

2.在VS代码中配置 --添加到 .vscode/mcp.json (工作区)或用户设置:

{
  "servers": {
    "dt-ppt-builder": {
      "command": "py",
      "args": ["c:\\repos\\dt-ppt-builder\\mcp_server.py"],
      "env": {}
    }
  }
}

3.在Claude Desktop中配置 --添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "dt-ppt-builder": {
      "command": "py",
      "args": ["c:\\repos\\dt-ppt-builder\\mcp_server.py"]
    }
  }
}

可用的MCP工具

工具 说明 示例提示
list_customers 显示所有可用的客户配置 “哪些客户有PPT配置?”
build_deck 根据客户配置生成PPTX “构建Acme Corp AI可观察性平台”
parse_excel 将requirements.xlsx转换为JSON “将C:\data\Acme_Metrics.xlx解析为需求JSON”
create_customer 构建一个新的客户配置目录 “为Acme Corp创建新的客户配置”
get_requirements 显示需求摘要和覆盖率统计数据 “给我看看Acme Corp的需求覆盖范围”

Copilot聊天对话示例

You:     "Build the Acme Corp deck"
Copilot: → calls build_deck(customer="example")
         ✅ Deck built: configs/example/example_deck.pptx (8.2 MB, 14 slides)
You:     "Parse C:\data\NewCo_Metrics.xlsx and save as requirements JSON"
Copilot: → calls parse_excel(excel_path="C:\data\NewCo_Metrics.xlsx",
                             output_json_path="configs/newco/requirements.json")
         ✅ Parsed: 6 domains, 112 requirements
You:     "Set up a new customer called 'acme' using the Corporate 2026 template"
Copilot: → calls create_customer(customer="acme",
                                 template_path="C:\templates\Corporate_2026.potx")
         ✅ Scaffolded: configs/acme/config.yaml + requirements.json

存储库布局

dt-ppt-builder/
├── mcp_server.py          — MCP tool server (stdio transport)
├── build_deck.py          — CLI entry point
├── requirements.txt
├── README.md
├── dt_ppt_builder/
│   ├── __init__.py        — package exports
│   ├── brand.py           — Dynatrace RGB colors + status_color()
│   ├── helpers.py         — low-level drawing: txb, req_table, status_bar …
│   ├── slide_builder.py   — slide factories: title, coverage, domain …
│   ├── builder.py         — orchestrator: config → deck → save / bytes
│   └── excel_parser.py    — Excel → requirements JSON converter
├── configs/
│   └── example/
│       ├── config.yaml        — paths, metadata, layout indices
│       └── requirements.json  — 134 requirements across 6 domains

添加新客户

选项A:通过MCP(推荐)

  1. 询问副驾驶: “为Acme Corp创建新的客户配置”
  2. 询问副驾驶: “解析C:\data\Acme_Metrics.xlx并保存到configs/Acme/requiries.json”
  3. 编辑 configs/acme/config.yaml 设置布局索引、屏幕截图等。
  4. 询问副驾驶: “建造Acme甲板”

选项B:手动

  1. 创建 configs/<customer>/ 目录。
  2. 复制 configs/example/config.yaml 并编辑:
    • customer, deck_title, deck_subtitle, contact
    • template (PPTX模板路径)
    • output (在哪里保存)
    • screenshots_dir + images 钥匙
    • screenshot_slides 列表
  3. 创建 configs/<customer>/requirements.json --结构与示例相同:
    [
      {
        "name": "Domain 1 of N · <Domain Name>",
        "description": "<short scope>",
        "reqs": [
          { "requirement": "...", "description": "...", "status": "✅ Now", "signal": "TRACE" },
          ...
        ]
      }
    ]
    
  4. 运行: py build_deck.py --config configs/<customer>/config.yaml

状态值

价值 徽章颜色 含义
✅ Now 绿色 在当前Dynatrace版本中可用
⚡ Partial 橙色 部分覆盖;需要额外的配置/扩展
🗺 Roadmap 灰色 在产品路线图上;尚未GA

布局索引参考(执行2026模板)

键 默认idx 布局名称(近似值)
title_center 11 仅标题+眉毛,居中
title_content 2 标题+眉毛+内容,居中
two_img 19 2张图片+字幕

覆盖 config.yaml 在...之下 layout_indices: 如果使用不同的模板。


关键设计决策

  • 无模板内容重用 --每张滑梯都是从头开始建造的;该模板仅提供品牌背景、字体和调色板。
  • 腐败安全滑梯清理 — prs.part.drop_rel(rId) 被调用之前 sldIdLst.remove(sId) 以避免强制PowerPoint修复的重复zip条目。
  • 配置驱动 --YAML控制所有路径和元数据;客户数据以JSON格式存在;代码与客户无关。
  • MCP优先 --设计用于人工智能代理调用;所有工具都返回结构化文本响应。

依赖项

包装 用途
python-pptx PPTX一代
Pillow 图像嵌入
PyYAML 配置文件解析
mcp MCP服务器SDK(stdio传输)
openpyxl Excel需求解析器
lxml 用于模板处理的XML操作