Skip to main content

A pure-Python converter from legacy PowerPoint .ppt files to .pptx

Project description

ppt2pptx

ppt2pptx converts Microsoft PowerPoint 97–2003 binary .ppt presentations to Office Open XML .pptx using only the Python standard library. It reads the CFB/OLE container and PowerPoint record stream directly; it never launches PowerPoint, LibreOffice, COM, or a conversion service.

The project is useful for a broad set of real presentations, but it is not a complete implementation of every legacy PowerPoint feature. Unsupported or lossy content is diagnosed instead of being silently presented as fully faithful.

Highlights

  • Opens RC4 CryptoAPI password-protected presentations when a password is supplied.
  • Preserves normal slide order and dimensions without mistaking masters or notes for slides.
  • Preserves hidden-slide state so excluded slides remain hidden during slide shows.
  • Restores positioned editable text, fonts, sizes, colors, bold/italic/underline, paragraph alignment, bullets, rotation, flips, and safe external hyperlinks.
  • Preserves PNG, JPEG, GIF, TIFF, EMF, WMF, and PICT media, including cropping, position, rotation, and flips when present.
  • Recreates common editable shapes, solid/gradient backgrounds, comments, speaker notes, slide numbers, dates, headers, and footers.
  • Copies common core properties such as title, author, keywords, and timestamps.
  • Supports atomic single-file and recursive batch conversion with JSON diagnostics.

Usage

python -m pip install ppt2pptx
ppt2pptx presentation.ppt
ppt2pptx presentation.ppt -o presentation.pptx --report report.json
ppt2pptx protected.ppt --password-file password.txt
ppt2pptx inspect presentation.ppt --json
ppt2pptx batch input-directory -o output-directory --recursive --report batch.json

The input is always read-only and output files are written atomically. The converter refuses to overwrite its input.

The Python API accepts the password directly:

from ppt2pptx import convert

result = convert("protected.ppt", "protected.pptx", password="secret")
print(result.report.to_dict())

Current limitations

Charts, SmartArt, animation timelines, audio/video playback, embedded OLE objects, and complex freeform or grouped master geometry remain incomplete. Solid and common gradient backgrounds are retained, while advanced fills and effects may be approximated. PICT data is preserved, but rendering depends on the PPTX consumer. PowerPoint 95 and earlier files use a different record format and are deliberately rejected with a clear error.

Development

python -m pip install -e .
PYTHONPATH=src python -m unittest discover -s tests -v
python -m build

The converter itself does not depend on LibreOffice. The real-file regression script may use LibreOffice only to verify that generated packages render:

PYTHONPATH=src python scripts/validate_real_files.py tests/real_samples \
  -o tests/real_output --render --password hello

Specification

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppt2pptx-0.3.2.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppt2pptx-0.3.2-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file ppt2pptx-0.3.2.tar.gz.

File metadata

  • Download URL: ppt2pptx-0.3.2.tar.gz
  • Upload date:
  • Size: 42.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ppt2pptx-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a39080ce3957a4ccb2e6dcf413346c2fabff77af9681421fa968b1257fb4cb51
MD5 2e9328078469fbe85920552dfef15ed0
BLAKE2b-256 8efd67317ed91cc6a154db6e412e733e9cc22ede60d32738134e2b8b284735c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ppt2pptx-0.3.2.tar.gz:

Publisher: publish-to-pypi.yml on HuiTurn/ppt2pptx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ppt2pptx-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ppt2pptx-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ppt2pptx-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3271c1936f3e80d9e92efecd66e2e8c3f2c578f7a55301842bdd3f1268961e8
MD5 9f719cba6b331a9dbcc1d9bce60d4d2e
BLAKE2b-256 724b1a5bb18587c2068938859d67505ce9a6351f16730f5665168ef1e079e860

See more details on using hashes here.

Provenance

The following attestation bundles were made for ppt2pptx-0.3.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on HuiTurn/ppt2pptx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page