Paper Office
paper-docxAPI referenceprotection

ProtectionStatus

paper-docx 0.2.0 API reference

What w:documentProtection declares, read-only.

edit is the raw w:edit token ("readOnly", "forms", "comments", "trackedChanges", or unrestricted "none") or None when no edit restriction is declared; formatting reflects the independent format restriction. enforced reports active enforcement of either kind; acknowledged is this package's in-memory override flag (never persisted).

ProtectionStatus(edit: Optional[str], enforced: bool, acknowledged: bool, formatting: bool = False)

Attributes

acknowledged

attributeacknowledgedbool

blocks_paper_edits

attributeblocks_paper_editsbool

True when protection is enforced and has not been acknowledged.

Not a prediction of whether a call will refuse: it ignores the operation class, so it reports True under trackedChanges or formatting-only protection where the gate still permits body edits and comments. Call acknowledge_protection to proceed deliberately.

edit

attributeeditOptional[str]

enforced

attributeenforcedbool

formatting

attributeformattingbool
= False

Functions

to_dict

functo_dict() -> dict

Returns

dict

On this page