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.4.tar.gz (51.9 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.4-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ppt2pptx-0.3.4.tar.gz
  • Upload date:
  • Size: 51.9 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.4.tar.gz
Algorithm Hash digest
SHA256 7fed7d1c083511c3dc988e2da228f02b1f08b41a227bda1e53715044855a975a
MD5 bb626cff05ddad376d0bfcb95a77fd35
BLAKE2b-256 767e246a494a03e106bb4af93cb3d141e54fe56f8b3c60055db4909165da2070

See more details on using hashes here.

Provenance

The following attestation bundles were made for ppt2pptx-0.3.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: ppt2pptx-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 44.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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e028d91dedddc0e2e8347e4c2ed67c72685973e5e74aabdd6899caf8d9ce745e
MD5 16abfea19ebf7505999d4dfc5a11b2b9
BLAKE2b-256 71cc090294f5e1f77e12e361b13ad676d91a147e09b74b52d7e1b7d47b6175d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ppt2pptx-0.3.4-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