# 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)

  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)

  Bases: `Serialisable`

  classmethod from_tree(node)

    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

    Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

  lock_structure

    Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

  lock_windows

    Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

  revision_password

    Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

  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)

    Set a revision password on this workbook.

  set_workbook_password(value='', already_hashed=False)

    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’>

  workbook_password

    Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)