# paper-docx

An import-compatible fork of the python-docx library for creating and editing Word documents, adding guarded APIs that refuse an operation it cannot represent safely instead of silently corrupting the file.

paper-docx keeps python-docx's docx import name and object model so existing code continues to work, while adding inspection and editing APIs meant to be safe for an AI agent to call unattended: rather than guessing at an ambiguous edit, it refuses operations it cannot represent correctly. Its highlighted feature is generating a Word redline between two versions of a document, writing the differences as tracked changes and again refusing changes it cannot express safely as track-changes markup.

Because both python-docx and paper-docx provide the same docx import package, the project's own installation instructions have a user uninstall python-docx before installing paper-docx, to avoid the two colliding in one environment; a bundled doctor command checks the installation afterward.

It is written in Python and licensed under MIT, inheriting python-docx's license and attribution.

Website: https://github.com/paper-instruments/paper-docx
