Skip to main content

PyOOXML

Overview

Purpose

View, edit and compare the parts inside OOXML packages (docx, xlsx, pptx and related formats), including damaged documents that other tools refuse to open.

PyOOXML is a Python 3 / PyQt6 port of the "OOXML Tools" browser extension by Atul Moglewar.

Installation

Install from the GitHub repository:

python3 -m pip install git+https://github.com/digitalsleuth/PyOOXML

PyQt6 is installed automatically. Then launch it with:

pyooxml

To run from a clone of the repository instead:

python3 -m pip install PyQt6
python3 -m pyooxml.pyooxml

Pip install forthcoming!

Usage

Documents can be passed on the command line, chosen from the File menu, or drag-and-dropped onto the window.

pyooxml                      # start empty
pyooxml document.docx        # view one document
pyooxml old.docx new.docx    # compare two documents

Supported files: .docx .docm .dotx .dotm .xlsx .xlsm .xltx .xltm .pptx .pptm .potx .potm .ppsx .ppsm .vsdx .zip

Viewer / Editor

  • Browse every part of the package in a tree, with a filter box to find parts quickly.
  • XML parts are pretty-printed with syntax highlighting and line numbers, and checked for well-formedness.
  • Images are displayed. Other binary parts show their size, SHA-256 and a hex dump of the first 4 KB.
  • The right-hand pane is read-only until you click Edit. Once the content changes, a Save Part button appears.
  • File > Save Package As... writes the package, including your edits, to a new file. File > Extract Part... saves the selected part on its own.

Compare

File > Compare Documents... (Ctrl+D) accepts one or two documents. If you choose only one, you are prompted for the second.

  • Every part is listed as Identical, Different, Only in left or Only in right. Differences only hides the identical ones.
  • Selecting a part shows a side-by-side diff of the formatted XML. Use Previous difference (Shift+F3) and Next difference (F3) to move between them, or simply scroll.
  • Swap sides exchanges the left and right documents, matters mostly for order of activity.
  • Export PDF... (also under the File menu) writes a landscape report containing only the differences, with changed lines highlighted and the exact changed values marked. It also records the full path, size and SHA-256 of both files, and any warnings raised while opening them.

Damaged and unusual documents

PyOOXML opens most documents whose zip structure is broken, for example files written by other applications that store \ instead of / in part names, or files with a damaged central directory. Parts are recovered from the raw zip data and verified against their CRC32 and size. Parts that cannot be verified are still shown, but are marked UNVERIFIED.

Anything unusual that was recovered is listed on the Warnings tab, which appears only when there is something to report. Encrypted or IRM-protected documents (OLE compound files) are detected and reported rather than failing with a zip error.

Original Source

This tool is based on the work originally developed by Atul Moglewar, and their Chrome Browser Extension "OOXML Tools". This particular version is no longer available, but I used a previous copy to reverse-engineer and improve upon its features.

Metadata

Release files for pyooxml 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyooxml 1.0.0
File Size Uploaded Provenance Actions
pyooxml-1.0.0.tar.gz 33.4 kB Without provenance Details for pyooxml-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyooxml 1.0.0
File Interpreter ABI Platform Actions
pyooxml-1.0.0-py3-none-any.whl Python 3 none any Details for pyooxml-1.0.0-py3-none-any.whl

Total release size: 65.6 kB

Release files / pyooxml-1.0.0.tar.gz

Download URL pyooxml-1.0.0.tar.gz
Size 33.4 kB
Tags Source
SHA-256 checksum
How to use checksums
be5d90a5292e624031dccf960ca1d068374333728514eae6f602667eaab721df
BLAKE2b-256 checksum
How to use checksums
3e0a4971cf385e953adc316303dd958d662b6414d2d4a93123a4994064b9dfce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pyooxml-1.0.0-py3-none-any.whl

Download URL pyooxml-1.0.0-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e3d2fdde80d892c398789af6bb160d488c716de43e8d47d54bbb9ec397277f2
BLAKE2b-256 checksum
How to use checksums
7d5453caf46d982085272733abff99cf6a3e4612422a455f6181ac6ff451e0a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for pyooxml 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page