openpyxl.workbook.protection module

openpyxl.workbook.protection.DocumentSecurity

alias of WorkbookProtection

class openpyxl.workbook.protection.FileSharing(readOnlyRecommended=None, userName=None, reservationPassword=None, algorithmName=None, hashValue=None, saltValue=None, spinCount=None)[source]

Bases: Serialisable

algorithmName

Values must be of type <class ‘str’>

hashValue
readOnlyRecommended

Values must be of type <class ‘bool’>

reservationPassword
saltValue
spinCount

Values must be of type <class ‘int’>

tagname = 'fileSharing'
userName

Values must be of type <class ‘str’>

class openpyxl.workbook.protection.WorkbookProtection(workbookPassword=None, workbookPasswordCharacterSet=None, revisionsPassword=None, revisionsPasswordCharacterSet=None, lockStructure=None, lockWindows=None, lockRevision=None, revisionsAlgorithmName=None, revisionsHashValue=None, revisionsSaltValue=None, revisionsSpinCount=None, workbookAlgorithmName=None, workbookHashValue=None, workbookSaltValue=None, workbookSpinCount=None)[source]

Bases: Serialisable

classmethod from_tree(node)[source]

Don’t hash passwords when deserialising from XML

lockRevision

Values must be of type <class ‘bool’>

lockStructure

Values must be of type <class ‘bool’>

lockWindows

Values must be of type <class ‘bool’>

lock_revision

Values must be of type <class ‘bool’>

lock_structure

Values must be of type <class ‘bool’>

lock_windows

Values must be of type <class ‘bool’>

property revision_password

Return the revisions password value, regardless of hash.

revisionsAlgorithmName

Values must be of type <class ‘str’>

revisionsHashValue
property revisionsPassword

Return the revisions password value, regardless of hash.

revisionsPasswordCharacterSet

Values must be of type <class ‘str’>

revisionsSaltValue
revisionsSpinCount

Values must be of type <class ‘int’>

set_revisions_password(value='', already_hashed=False)[source]

Set a revision password on this workbook.

set_workbook_password(value='', already_hashed=False)[source]

Set a password on this workbook.

tagname = 'workbookPr'
workbookAlgorithmName

Values must be of type <class ‘str’>

workbookHashValue
property workbookPassword

Return the workbook password value, regardless of hash.

workbookPasswordCharacterSet

Values must be of type <class ‘str’>

workbookSaltValue
workbookSpinCount

Values must be of type <class ‘int’>

property workbook_password

Return the workbook password value, regardless of hash.