docx-trackdiff
Compare two Word documents (.docx) and get a native Track Changes redline — as if a human editor had revised the old draft into the new one with "Track Changes" switched on. One command in, one verified tracked-changes .docx out.
- ✍️ A working document, not a report — real
<w:ins>/<w:del>revisions with unique IDs, author, and date; accept or reject each change individually in Word, WPS, or LibreOffice - 🔍 Word-level precision — modified paragraphs get fine-grained inline diffs (
12%→1218%), not crude whole-paragraph replace - 🖼️ Lossless in both directions, images included — a replaced figure keeps the old image's original bytes inside its deletion mark, so "reject change" truly restores the old picture
- ✅ Every output machine-verified — the bundled verifier runs 7 automated checks: simulated accept all must equal the new file, simulated reject all must equal the old file, plus structural checks
- 🪶 Radically lightweight — pure Python +
lxml; no runtimes, no SDKs, no prebuilt binaries - 🔒 Private by default — 100% local, no upload, no network call
Install
pip install docx-trackdiff
Usage
# 1. Generate the tracked-changes document
docx-trackdiff OLD.docx NEW.docx OUTPUT.docx --author "Your Name"
# 2. Verify (7 automated checks)
docx-trackdiff-verify OUTPUT.docx OLD.docx NEW.docx
Open OUTPUT.docx in Word → Review tab → All Markup. Accept or reject each change individually.
Options
| Flag | Default | Meaning |
|---|---|---|
--author |
Editor |
Revision author shown in Word's markup panel |
--date |
today | Revision timestamp |
--threshold |
0.45 |
Paragraph similarity cutoff: above → inline word-level diff; below → whole-paragraph delete+insert |
Links
- GitHub: https://github.com/stephenlzc/docx-trackdiff
- Evaluation report: https://github.com/stephenlzc/docx-trackdiff/blob/main/EVALUATION.md
MIT licensed. Built with Kimi K3 Agent Swarm by Moonshot AI.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docx_trackdiff-1.0.0.tar.gz.
File metadata
- Download URL: docx_trackdiff-1.0.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ec02041f15779cbd4f058475c65f2c32096b96e09cb18594ef409767804470a
|
|
| MD5 |
0080d5ce91ed4618958019ddc52490ed
|
|
| BLAKE2b-256 |
9cfa1448d4a2855448b3be4d1dd29f6ac8b9149b659e2b1b1d34d3ee1c29196e
|
Provenance
The following attestation bundles were made for docx_trackdiff-1.0.0.tar.gz:
Publisher:
publish.yml on stephenlzc/docx-trackdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docx_trackdiff-1.0.0.tar.gz -
Subject digest:
0ec02041f15779cbd4f058475c65f2c32096b96e09cb18594ef409767804470a - Sigstore transparency entry: 2478743904
- Sigstore integration time:
-
Permalink:
stephenlzc/docx-trackdiff@43ca8eb8945c130c5f1e8b6ede78bb3cdd1975fa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stephenlzc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43ca8eb8945c130c5f1e8b6ede78bb3cdd1975fa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file docx_trackdiff-1.0.0-py3-none-any.whl.
File metadata
- Download URL: docx_trackdiff-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d65d99abd58de8917f82a979146a0dbf9df6ace7be5cceca66493abd312f95
|
|
| MD5 |
a41408b3f6ad12a243ad937acbbf8327
|
|
| BLAKE2b-256 |
d116125305edb14a5ebb4ec26a7ad10ca332d5a48a0f7001006fa15301fa8a0a
|
Provenance
The following attestation bundles were made for docx_trackdiff-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on stephenlzc/docx-trackdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docx_trackdiff-1.0.0-py3-none-any.whl -
Subject digest:
d3d65d99abd58de8917f82a979146a0dbf9df6ace7be5cceca66493abd312f95 - Sigstore transparency entry: 2478744021
- Sigstore integration time:
-
Permalink:
stephenlzc/docx-trackdiff@43ca8eb8945c130c5f1e8b6ede78bb3cdd1975fa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stephenlzc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43ca8eb8945c130c5f1e8b6ede78bb3cdd1975fa -
Trigger Event:
workflow_dispatch
-
Statement type: