Lightweight track-changes engine for Microsoft Word (.docx) files using direct XML manipulation.
reddocx provides a minimal and fast way to programmatically add tracked revisions
(insertions and deletions) to Word documents without requiring Microsoft Word or
heavy document processing libraries.
- Default Installation
pip install reddocx- UV installation
uv pip install reddocxfrom reddocx.core.document import DocxDocument
doc = DocxDocument('sample.docx')
updated_report = doc.track_replace_words({'original_word':'replaced_word'})
updated_doc = doc.save()- Word-style tracked changes (insert / delete revisions)
- Paragraph-level word replacement tracking
- Pure XML processing using lxml
- No Microsoft Word dependency
- Lightweight and fast
- Supports file path, bytes, or memory streams