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.3.tar.gz (50.4 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.3-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ppt2pptx-0.3.3.tar.gz
  • Upload date:
  • Size: 50.4 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.3.tar.gz
Algorithm Hash digest
SHA256 574e300777a2495631b2cf31eae4d35a165dac35e510a37875da99cb10d3c994
MD5 9ab7933e2ca62c5c1271257d89c24b75
BLAKE2b-256 99cb2e8b367f4fe69cd11c429bff1925ea5cc6fee03a29ed01a969a07ced1beb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ppt2pptx-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 44.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6c87c1cc24770616e8e2df82a0c3ddeda8b6c45902174b13818cf6e64288fd61
MD5 5ae27d16ca2d6b6b74d1f9a756a5948d
BLAKE2b-256 d57a1ea26657a9b4062a92ddb16c0b4fe1829a4c78dfcdd4ad31faa59ee7e373

See more details on using hashes here.

Provenance

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