paper-docx is a drop-in, import-compatible fork of python-docx that rethinks Word document editing for safety and automated agents. It claims a 78% reduction in DOCX failures by adding guarded inspection and editing APIs that refuse unsupported operations instead of guessing and silently corrupting files. The project preserves the original python-docx object model and import name so existing code can run with minimal changes, but switches to an agent-first, structure-editor approach that makes operations explicit and verifiable. A provided compare utility demonstrates the approach by producing tracked-change redlines and refusing edits it cannot represent safely.
The repository includes install instructions (uninstall python-docx first; do not co-install both), a doctor tool for diagnostics, documentation, tests, and contribution guidance. It maintains the upstream MIT license and credits the original authors while adding Paper Instruments’ changes. The codebase shows active development (many commits), and basic project metadata (stars, forks) indicates modest community interest. The concrete takeaways: safer document manipulation for automation and agents, API compatibility for migration, refusal-on-ambiguity behavior to avoid silent corruption, and tooling to compare and validate DOCX edits.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.