Paper Office
paper-docxAPI referencerevision

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

attributeanchorAnchor

author

attributeauthorstr

date

attributedateOptional[dt.datetime]

is_paragraph_mark

attributeis_paragraph_markbool

is_resolvable

attributeis_resolvablebool

revision_type

attributerevision_typestr

story

attributestorystr

text

attributetextstr

Functions

accept

funcaccept() -> None

Apply 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

None

reject

funcreject() -> None

Undo 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

None

to_dict

functo_dict() -> dict

Returns

dict

On this page