Paper Office
paper-docxAPI referencerevision

docx.revision

paper-docx 0.2.0 API reference

Revision enumeration and resolution (paper-docx, Document.revisions).

Enumerates every tracked change across every story part and resolves them: accept applies the change (insertions unwrap, deletions disappear), reject undoes it (insertions disappear, deleted text returns as live w:t).

Paragraph-mark revisions (w:pPr/w:rPr/w:ins|w:del, as emitted by docx.blocks) are handled with the content: accepting a mark-deleted paragraph that has no visible content left removes the paragraph; rejecting a mark-inserted paragraph removes it entirely.

Resolution mutates the in-memory document; save with docx.package.patch_save to keep the changed-part budget narrow.

RESOLVABLE_TYPES

attributeRESOLVABLE_TYPES
= frozenset({'insertion', 'deletion', 'format_change', 'row_insertion', 'row_deletion', 'move_from', 'move_to'})

On this page