WolfPPT Commercial - deck assembly
Copy slides from one PowerPoint deck to another in Python without losing theme fonts
python-pptx has no API for copying a slide between presentations, and the common workaround of copying shape XML drops the slide's layout, master, theme fonts, charts, and media links. WolfPPT Commercial's wolfppt-assemble command copies each selected slide together with everything it references, so imported slides keep their own theme fonts, layouts, masters, charts, notes, and media, and stay editable. Use it to append a regional appendix to a board deck, or to build one deck from slides kept in several approved source decks.
Append two slides from another deck
import json
import subprocess
def assemble(*args: str) -> dict:
run = subprocess.run(["wolfppt-assemble", *args], capture_output=True, text=True)
receipt = json.loads(run.stdout)
if not receipt["ok"]:
raise RuntimeError(receipt["error"])
return receipt
board = assemble("--operation", "assembly-targets", "--input", "board_deck.pptx")
appendix = assemble("--operation", "assembly-targets", "--input", "regional_appendix.pptx")
picked = [s for s in appendix["slides"] if s["slide_index"] in (0, 2)]
with open("assembly.json", "w") as request:
json.dump({
"destination_sha256": board["source_sha256"],
"insertion_index": len(board["slides"]), # append after the last slide
"sources": [{
"path": "regional_appendix.pptx",
"source_sha256": appendix["source_sha256"],
"slide_indexes": [s["slide_index"] for s in picked],
"expected_slide_ids": [s["slide_id"] for s in picked],
}],
}, request)
receipt = assemble("--request", "assembly.json", "--input", "board_deck.pptx",
"--output", "board_deck_with_appendix.pptx")
print(receipt["source_formatting"], receipt["imported"][0]["destination_slide_ids"])
# preserved [...new slide ids...]assembly-targets reads a deck without changing it and returns its SHA-256, slide size, and each slide's index and id. The request names the exact destination and source bytes and the slide ids you expect, so a deck that changed after you listed it is refused instead of producing the wrong appendix. The output is checked before it is published, and the destination and sources are hashed again just before the file is written.
What the imported slides keep
- Their own slide master, layout, and theme, including theme fonts and colors.
- Charts with their embedded workbooks, pictures and other media, speaker notes, and comments.
- Sections and zoom links that point at the imported slides.
The assembly keeps source formatting. It does not restyle imported slides to the destination's theme, and it refuses a source deck whose slide size differs from the destination's.
Evidence and limits
- The committed PPTX coverage census for slide cloning and import lists 157 supported, 68 preserved, and 70 refused cases. See the cross-format coverage table.
- Deck assembly is part of WolfPPT Commercial. The free MIT WolfPPT package does not include it.
- Copying keeps each imported slide's own master, so a deck assembled from many sources can carry several masters. Consolidating them is a separate design decision.
- For edits inside a deck you already have, the free package is enough: see the python-pptx alternative.
Get WolfPPT Commercial
WolfPPT Commercial is an organization-scoped subscription at $500 per year or $50 per month for one legal organization, not per developer. The public MIT Community package is on public PyPI. WolfPPT Commercial installs the wolfppt-pro add-on from the authenticated WolfPPT package index with a per-purchase credential, issued on the checkout success page after payment and reissued through https://wolfxl.com/recover.
pip install wolfppt-pro --index-url https://packages.wolfxl.com/wolfppt/simple/The public WolfPPT Community release is MIT-licensed and free, including commercial use. WolfPPT Commercial does not change those rights.
Related tasks
- Update text in an existing PowerPoint deck with Python
- Update a table in an existing PowerPoint deck with Python
- Update chart data in an existing PowerPoint deck with Python
- Convert PPTX to PDF in Python without PowerPoint or LibreOffice: Wolf Runtime workflow (commercial or evaluation, not in the pip package)
- python-pptx limitations, and an alternative for editing existing PowerPoint decks
- Copy slides from one PowerPoint deck to another in Python without losing theme fonts