Revision
paper-docx 0.2.0 API reference
One tracked change, addressable — and resolvable when supported.
Resolvable revision_types: "insertion", "deletion", "format_change"
(w:rPrChange/w:pPrChange, run or paragraph mark), "row_insertion",
"row_deletion" (w:trPr row markers), and — as paired units —
"move_from"/"move_to". The exotic remainder ("table_property_change",
"cell_revision", "section_property_change", "numbering_change",
"custom_xml_revision") is enumerated and counted but resolution is
refused by name — claiming to resolve them would report false state.
Revision(revision_type: str, author: str, date: Optional[dt.datetime], text: str, story: str, anchor: Anchor, is_paragraph_mark: bool, _element: '_Element', _document: 'Optional[Document]' = None, _snapshot_signature: 'Tuple[_Element, ...]' = ())Attributes
anchor
attributeanchorAnchorauthor
attributeauthorstrdate
attributedateOptional[dt.datetime]is_paragraph_mark
attributeis_paragraph_markboolis_resolvable
attributeis_resolvableboolrevision_type
attributerevision_typestrstory
attributestorystrtext
attributetextstrFunctions
accept
funcaccept() -> NoneApply this change to the document.
Tracked moves resolve as a PAIR: accepting either site accepts both. Resolution can remove paragraphs, rows, tables, comments and note bodies along with the markup. Refuses a protected document, and revision types this package cannot resolve, leaving the document untouched.
Returns
Nonereject
funcreject() -> NoneUndo this change, restoring the pre-change content.
Tracked moves resolve as a PAIR: rejecting either site rejects both. Restores w:delText
back to w:t. Refuses a protected document, and revision types this package cannot
resolve, leaving the document untouched.
Returns
Noneto_dict
functo_dict() -> dictReturns
dict