Python PowerPoint API for Presentations
Create, read, modify, merge, clone, protect, and convert PowerPoint and OpenDocument presentations in Python without requiring Microsoft PowerPoint for core presentation operations.
Download Free TrialAspose.Slides for Python via .NET is a presentation processing library that lets Python applications read, edit, manipulate, and convert PowerPoint and OpenDocument presentations without requiring Microsoft PowerPoint for core presentation processing. Optional workflows such as video encoding and AI-powered translation use external tools or services.
The library is suitable for server-side automation, batch processing, and desktop workflows on Windows, Linux, and macOS.
Aspose.Slides for Python via .NET provides these popular features:
- Loading, opening, and viewing presentations.
- Editing presentations.
- Converting presentations to PDF, JPG, HTML, GIF, SVG, and many other formats.
- Rendering and printing presentations.
- Generating slide frames and timing data for videos with animations and transitions; encoding the frames into a video file requires an external tool such as FFmpeg.
- Automatically translating presentations using AI-powered translation through external language model integration.
- Encrypting and decrypting presentations; password-protecting presentations and removing passwords.
- Manipulating presentation elements such as master slides, shapes, charts, picture frames, audio frames, video frames, OLE objects, VBA macros, and animations.
Python developers can use Aspose.Slides for Python via .NET in web applications, desktop software, data-processing pipelines, and research or academic projects.
Advanced Python PowerPoint API Features
Create or clone slides from templates
Work with PowerPoint tables via API
Apply or remove shape protection
Add Excel charts as OLE objects to slides
Support linked OLE objects
Generate presentations from a database
Protect presentations and generated PDFs
Print presentations on a physical printer
Create and customize charts
System Requirements
- Compatible with Python 3.5 or later
- For Python development on Linux, see the additional Linux requirements.
How to Install
Use pip to install the Aspose.Slides Python library for presentation processing from the PyPI repository:
pip install aspose-slides
Create a New PowerPoint Presentation in Python
The following example adds a line shape to the first slide of a presentation.
with slides.Presentation() as presentation:
slide = presentation.slides[0]
slide.shapes.add_auto_shape(slides.ShapeType.LINE, 50, 150, 300, 0)
presentation.save("presentation.pptx", slides.export.SaveFormat.PPTX)
Merge Presentations in Python
This Python code shows you how to merge presentations:
with slides.Presentation("presentation1.pptx") as destination_presentation:
with slides.Presentation("presentation2.pptx") as source_presentation:
for slide in source_presentation.slides:
destination_presentation.slides.add_clone(slide)
destination_presentation.save("combined.pptx", slides.export.SaveFormat.PPTX)
Import a Presentation from PDF in Python
This Python code demonstrates the PDF to PowerPoint conversion process:
with slides.Presentation() as presentation:
presentation.slides.remove_at(0)
presentation.slides.add_from_pdf("welcome_to_powerpoint.pdf")
presentation.save("output_presentation.pptx", slides.export.SaveFormat.PPTX)
Convert PowerPoint to PDF with Default Options in Python
This Python code shows how to convert a PowerPoint or OpenDocument presentation to PDF using the default options.
with slides.Presentation("presentation.ppt") as presentation:
presentation.save("document.pdf", slides.export.SaveFormat.PDF)
Convert PowerPoint to JPG in Python
The following example shows you how to convert a PPT, PPTX, or OpenDocument Presentation (ODP) file into a set of JPEG images.
with slides.Presentation("presentation.pptx") as presentation:
for slide in presentation.slides:
with slide.get_image(1, 1) as slide_image:
slide_image.save(f"slide_{slide.slide_number}.jpg", slides.ImageFormat.JPEG)
FAQ
- How do I install Aspose.Slides for Python via .NET?
pip install aspose-slidesfrom PyPI. There is no separate runtime to install — the .NET components the library needs ship inside the wheel. - Which Python versions does it support, and does it work on Linux?Python 3.5 and later, on Windows, Linux and macOS. Linux has a small set of extra system requirements, listed in the installation documentation.
- How does it compare with python-pptx?python-pptx reads and writes PPTX and is free and MIT-licensed; it does not render. Aspose.Slides adds PDF and image export, legacy
.pptand ODP support, animations and encryption. The tested comparison runs both libraries and records what each one did. - Do I need Microsoft PowerPoint installed?No. The library parses and writes the file formats itself, so it runs in containers, on CI workers and on Linux servers with no Office present.
- What does the library do if no licence is applied?It runs, but every export is stamped with an Evaluation only notice and a line naming the product and version. Setting a licence at start-up removes the stamp.
What People Are Saying
Don't just take our word for it. See what users have to say about PowerPoint APIs.
Support and Learning Resources
- Learning Resources
- Documentation
- Source Code
- API References
- Product Support
- Free Support
- Paid Support
- Blog
- Release Notes
- Why Aspose.Slides for Python via .NET?
- Customers List
- Success Stories