Paper Office
paper-docxAPI referencerevision

Revisions

paper-docx 0.2.0 API reference

All tracked changes in a document, across every story part.

A fresh snapshot is enumerated on each Document.revisions access; mutation through another snapshot invalidates this snapshot and its previously-held Revision objects. Stale resolution attempts refuse.

Revisions(document: 'Document')

Functions

__getitem__

func__getitem__(key)
paramkey

__iter__

func__iter__() -> Iterator[Revision]

Returns

typing.Iterator[docx.revision.Revision]

__len__

func__len__() -> int

Returns

int

accept_all

funcaccept_all(*, author: Optional[str] = None) -> int

Apply every selected revision (optionally only author's) and return the count.

Validates the whole selected set first, so a set holding types this package cannot resolve refuses atomically instead of half-resolving and reporting success while Word still shows changes. Refuses a protected document and a stale snapshot. Check remaining_unsupported() before concluding the document is clean.

paramauthorOptional[str]
= None

Returns

int

reject_all

funcreject_all(*, author: Optional[str] = None) -> int

Undo every selected revision (optionally only author's) and return the count.

Same whole-set validation, refusals and census semantics as accept_all.

paramauthorOptional[str]
= None

Returns

int

remaining_unsupported

funcremaining_unsupported() -> dict

{revision_type: count} for enumerated-but-unresolvable revisions.

Returns

dict

to_dict

functo_dict() -> dict

Returns

dict

On this page