Receber por email
← Voltar para o catálogo

pptx

Professional PowerPoint presentation creation, editing, and automation with support for layouts, templates, charts, images, and formatting. Use when working with .pptx files for: (1) Creating presentations from scratch, (2) Editing existing presentations, (3) Applying templates and themes, (4) Adding charts and visualizations, (5) Bulk slide generation, (6) Presentation automation

21estrelas
Atualizado há 1 ano

Ver no GitHub ↗

Como adicionar

/plugin marketplace add AutumnsGrove/ClaudeSkills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/pptx-autumnsgrove/svg)](https://www.skillteca.com.br/skills/pptx-autumnsgrove)

Skills relacionadas

Ver todas de Documentos →

Alerta por categoria

Receba novas skills de Documentos toda segunda

1 email curto, só com as skills novas de Documentos. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

PowerPoint (PPTX) Skill

Overview

This skill provides comprehensive PowerPoint presentation creation, editing, and automation capabilities using Python's python-pptx library. Create professional presentations programmatically with full control over layouts, themes, content, charts, and visualizations.

Core Capabilities

  • Presentation Creation: New presentations, templates, metadata, page configuration
  • Slide Management: Add, duplicate, delete, reorder slides with predefined layouts
  • Content Types: Text, shapes, images, tables, charts, SmartArt, hyperlinks
  • Design & Formatting: Themes, color schemes, fonts, fills, borders, effects
  • Advanced Features: Transitions, animations, embedded objects, video/audio, comments

Installation

Install the required library:

pip install python-pptx
# or with uv
uv pip install python-pptx

Basic imports:

from pptx import Presentation
from pptx.util import Inches, Pt, Cm
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE

For complete library setup and supporting packages (Pillow, pandas, matplotlib), see references/library-setup.md.

Core Workflows

Workflow 1: Creating a Business Presentation

Goal: Create a professional presentation with title slide, content slides, and conclusion.

Steps:

  1. Initialize Presentation
  2. Create new presentation object
  3. Set slide dimensions (standard 16:9 or 4:3)
  4. Configure metadata (title, author, subject, keywords)
  1. Add Title Slide
  2. Use title slide layout (typically prs.slide_layouts[0])
  3. Set title and subtitle text
  4. Apply formatting (font size, color, bold)
  1. Add Content Slides
  2. Use appropriate layouts (bullet, two-column, title-only, blank)
  3. Populate placeholders or add text boxes
  4. Format text with proper hierarchy
  1. Add Visual Elements
  2. Insert images with proper sizing and positioning
  3. Add charts with formatted data
  4. Create tables with cell styling
  1. Save Presentation
  2. Save to .pptx format
  3. Verify file creation

Quick Example:

from pptx import Presentation
from pptx.util import Inches, Pt

prs = Presentation()
prs.slide_width = Inches(10)
prs.slide_height = Inches(7.5)

# Title slide
slide = prs.slides.add_slide(prs.slide_layouts[0])
slide.shapes.title.text = "Q4 Business Review"
slide.placeholders[1].text = "Prepared by: Jane Doe\nDate: October 25, 2025"

prs.save('presentation.pptx')

See examples/business-presentation.md for complete implementation.

Workflow 2: Adding Charts

Goal: Create data visualizations with bar, line, and pie charts.

Steps:

  1. Prepare chart data using CategoryChartData
  2. Define categories and series
  3. Add chart to slide with positioning
  4. Format chart (legend, gridlines, labels)

Quick Example:

from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE

chart_data = CategoryChartData()
chart_data.categories = ['Q1', 'Q2', 'Q3', 'Q4']
chart_data.add_series('2025', (9.5, 10.8, 11.2, 13.1))

chart = slide.shapes.add_chart(
    XL_CHART_TYPE.COLUMN_CLUSTERED,
    Inches(1), Inches(2), Inches(8), Inches(4.5),
    chart_data
).chart

See examples/chart-examples.md for all chart types.

Workflow 3: Working with Images

Goal: Add, position, and format images in presentations.

Steps:

  1. Add image with slide.shapes.add_picture()
  2. Specify position (left, top) and size (width, height)
  3. Calculate centered positioning if needed
  4. Optimize images before adding (use Pillow for preprocessing)

Quick Example:

# Add image with auto-scaled aspect ratio
pic = slide.shapes.add_picture('logo.png', Inches(1), Inches(1), height=Inches(2))

# Center image on slide
pic.left = int((prs.slide_width - pic.width) / 2)
pic.top = int((prs.slide_height - pic.height) / 2)

See examples/image-handling.md for advanced techniques.

Workflow 4: Creating Tables

Goal: Add structured data tables with formatting.

Steps:

  1. Define table dimensions (rows, cols)
  2. Add table with positioning
  3. Set column widths
  4. Populate headers with bold formatting and background color
  5. Fill data cells with proper alignment

Quick Example:

table = slide.shapes.add_table(4, 3, Inches(1.5), Inches(2), Inches(7), Inches(3)).table

# Header formatting
cell = table.cell(0, 0)
cell.text = "Product"
cell.text_frame.paragraphs[0].font.bold = True
cell.fill.solid()
cell.fill.fore_color.rgb = RGBColor(0, 51, 102)

See examples/table-examples.md for advanced formatting.

Workflow 5: Editing Existing Presentations

Goal: Modify existing PowerPoint files.

Steps:

  1. Open presentation with Presentation('file.pptx')
  2. Iterate through slides to find content
  3. Modify text, shapes, or add new elements
  4. Save with same or different filename

Quick Example:

prs = Presentation('existing.pptx')

# Find and update text
for slide in prs.slides:
    for shape in slide.shapes:
        if hasattr(shape, "text") and "Old Name" in shape.text:
            shape.text = shape.text.replace("Old Name", "New Name")

prs.save('updated.pptx')

See examples/editing-presentations.md for slide copying and advanced editing.

Workflow 6: Using Templates

Goal: Apply consistent branding with master slides and templates.

Steps:

  1. Start with template file: Presentation('template.pptx')
  2. Examine available layouts
  3. Add slides using template layouts
  4. Apply brand colors consistently

Quick Example:

prs = Presentation('corporate_template.pptx')

# Use template layouts
title_slide = prs.slides.add_slide(prs.slide_layouts[0])
content_slide = prs.slides.add_slide(prs.slide_layouts[1])

# Layouts inherit master formatting
prs.save('branded_presentation.pptx')

See references/templates-and-themes.md for master slide customization.

Workflow 7: Bulk Slide Generation

Goal: Generate multiple slides automatically from data.

Steps:

  1. Load data from CSV, JSON, or database
  2. Create presentation object
  3. Iterate through data records
  4. Generate one slide per record
  5. Populate slide with record data

Quick Example:

import pandas as pd

df = pd.read_csv('employee_data.csv')
prs = Presentation()

for _, row in df.iterrows():
    slide = prs.slides.add_slide(prs.slide_layouts[1])
    slide.shapes.title.text = row['Name']
    # Add employee details to slide body

prs.save('employee_directory.pptx')

See examples/bulk-generation.md for complete implementations.

Design Principles

Color & Typography

  • Use 60-30-10 color rule (60% primary, 30% secondary, 10% accent)
  • Ensure WCAG AA contrast ratios (4.5:1 minimum)
  • Limit to 2 font families maximum
  • Minimum body text: 18pt for readability

Layout & Composition

  • Follow rule of thirds for element placement
  • Maintain minimum 0.5" margins on all sides
  • Limit to 5-7 elements per slide
  • Use consistent alignment (snap to grid)

Visual Hierarchy

  • Size indicates importance (larger = more important)
  • Use color contrast for emphasis
  • Follow Z-pattern for content flow

Chart Best Practices

  • Choose appropriate chart type (bar for comparison, line for trends, pie for parts-of-whole)
  • Limit to 3-5 colors maximum
  • Always label axes and include data labels
  • Use gridlines sparingly

For complete design guidelines, see references/design-best-practices.md.

Common Patterns

Brand Color Application

BRAND_COLORS = {
    'primary': RGBColor(0, 51, 102),
    'secondary': RGBColor(0, 153, 204),
    'accent': RGBColor(255, 102, 0)
}

# Apply to text
shape.text_frame.paragraphs[0].font.color.rgb = BRAND_COLORS['primary']

# Apply to fill
shape.fill.solid()
shape.fill.fore_color.rgb = BRAND_COLORS['secondary']

Centered Eleme

Compartilhar X LinkedIn