Skill 詳細

python-pptx

Direct programmatic PowerPoint creation and manipulation skill.

一致度直接一致powerpoint プレゼンテーション 向けにレビュー済み
出典vamseeachanta/workspace-hub外部ソース
報告インストール数32人気度の参考値

使用前に確認

自動レビューは関連性のみを確認し、安全性や推奨を保証しません。使用前に出典の説明を読んでください。

保存された出典プレビュー

SKILL.md

これはレビュー時に保存された抜粋です。完全で最新の内容は外部ソースを確認してください。

---
name: python-pptx
description: Create and manipulate PowerPoint presentations programmatically. Build slide decks with layouts, shapes, charts, tables, and images. Generate data-driven presentations from templates.
version: 1.0.0
category: office-docs
type: skill
capabilities:
  - presentation_creation
  - slide_layouts
  - shape_manipulation
  - chart_generation
  - table_creation
  - image_insertion
  - template_based_generation
  - master_slide_customization
tools:
  - python
  - python-pptx
  - Pillow
tags: [powerpoint, pptx, presentation, slides, charts, office-automation]
platforms: [windows, macos, linux]
related_skills:
  - python-docx
  - openpyxl
  - plotly
---

# Python-pptx PowerPoint Automation Skill

## Overview

Python-pptx is a Python library for creating and updating PowerPoint (.pptx) presentations. This skill covers comprehensive patterns for presentation automation including:

- **Presentation creation** with multiple slide layouts
- **Shape manipulation** including text boxes, images, and geometric shapes
- **Chart generation** for data visualization within slides
- **Table creation** for structured data display
- **Master slide customization** for branding consistency
- **Template-based generation** for consistent presentations
- **Placeholder management** for dynamic content insertion

## When to Use This Skill

### USE when:
- Generating presentations from data automatically
- Creating standardized report presentations
- Building slide decks with consistent branding
- Automating dashboard presentations
- Creating training materials from templates
- Generating client presentations from databases
- Building presentation pipelines for regular reports
- Creating slides with charts and tables from data
- Mass-producing presentations with variable content

### DON'T USE when:
- Need real-time presentation editing (use PowerPoint)
- Creating presentations with complex animations
- Need advanced transitions (limited support)
- Require embedded videos with playback controls
- Need to preserve complex PowerPoint features
- Creating presentations from scratch without Python (use PowerPoint)

## Prerequisites

### Installation

```bash
# Basic installation
pip install python-pptx

# Using uv (recommended)
uv pip install python-pptx

# With image support
pip install python-pptx Pillow

# Full installation for charts
pip install python-pptx Pillow lxml
```

### Verify Installation

```python
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN

print("python-pptx installed successfully!")
```

## Core Capabilities

### 1. Basic Presentation Creation

```python
"""
Create a basic PowerPoint presentation with common slide types.
"""
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.dml.color import RgbColor
from pptx.enum.shapes import MSO_SHAPE

def create_basic_presentation(output_path: str) -> None:
    """Create a basic presentation with various slide types."""
    # Create presentation
    prs = Presentation()

    # Set slide dimensions (16:9 widescreen)
    prs.slide_width = Inches(13.333)
    prs.slide_height = Inches(7.5)

    # Slide 1: Title Slide
    title_layout = prs.slide_layouts[0]  # Title slide layout
    slide1 = prs.slides.add_slide(title_layout)

    title = slide1.shapes.title
    subtitle = slide1.placeholders[1]

    title.text = "Q1 2026 Business Review"
    subtitle.text = "Strategic Planning and Performance Analysis"

    # Format title
    for paragraph in title.text_frame.paragraphs:
        paragraph.font.size = Pt(44)
        paragraph.font.bold = True

    # Slide 2: Title and Content
    bullet_layout = prs.slide_layouts[1]  # Title and content
    slide2 = prs.slides.add_slide(bullet_layout)

    title2 = slide2.shapes.title
    body2 = slide2.placeholders[1]

    title2.text = "Key Highlights"

    tf = body2.text_frame
    tf.
GitHub で全文を読む (外部ページ)
関連情報

関連する仕事