Animations & Transitions
power-pptx exposes PowerPoint's animation model from Python: preset effects, motion paths, per-paragraph reveal, and a sequencing context manager — plus per-slide and deck-wide transitions.
Animations
from power_pptx import Presentation
from power_pptx.animation import Entrance, Exit, Emphasis, MotionPath, Trigger
from power_pptx.util import Inches
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[5]) # Title Only
slide.shapes.title.text = "Animated demo"
shape = slide.shapes.add_text(
Inches(1), Inches(2), Inches(4), Inches(1), text="Hello"
)
Entrance.fade(slide, shape) # default: ON_CLICK
Entrance.fly_in(slide, shape, direction="left") # top/bottom/left/right
Emphasis.pulse(slide, shape, trigger=Trigger.WITH_PREVIOUS)
Exit.wipe(slide, shape, trigger=Trigger.AFTER_PREVIOUS, delay=200) # delay in ms
# Motion path preset
MotionPath.arc(slide, shape, dx=Inches(2), dy=Inches(0), height=0.4)Per-paragraph reveal
# Reveal a text frame one paragraph per click, in order
body = slide.shapes.add_textbox(Inches(1), Inches(3.4), Inches(8), Inches(2))
body.text_frame.text = "First point\nSecond point\nThird point"
Entrance.fade(slide, body.text_frame, by_paragraph=True)Sequencing
badge = slide.shapes.add_text(
Inches(6.5), Inches(1.2), Inches(2.5), Inches(0.6), text="NEW"
)
# First effect fires on click; the rest chain with AFTER_PREVIOUS
with slide.animations.sequence():
Entrance.fade(slide, slide.shapes.title)
Entrance.zoom(slide, badge)
Emphasis.pulse(slide, badge)Transitions
from power_pptx.enum.presentation import MSO_TRANSITION_TYPE
# Deck-wide default first...
prs.set_transition(kind=MSO_TRANSITION_TYPE.FADE, duration=400) # milliseconds
# ...then override individual slides (Morph is a first-class p14 kind)
slide.transition.kind = MSO_TRANSITION_TYPE.MORPH
slide.transition.duration = 1500
prs.save("animated.pptx")Morph and the other p14: extension transitions are first-class — PowerPoint 2019+ renders them natively and older versions degrade gracefully.