fromgroupdocs.metadataimportMetadatafromgroupdocs.metadata.commonimportFileFormatfromgroupdocs.metadata.optionsimportLoadOptionsdefload_password_protected_document():# Specify the password for a protected fileload_options=LoadOptions()load_options.password="123"withMetadata("protected.docx",load_options)asmetadata:print(f"Opened protected {metadata.file_format} document")defload_file_of_specific_format():# Explicitly set the file format to avoid detection overheadload_options=LoadOptions(FileFormat.SPREADSHEET)withMetadata("input.xlsx",load_options)asmetadata:root=metadata.get_root_package()print(f"Author: {root.document_properties.author}")if__name__=="__main__":load_password_protected_document()load_file_of_specific_format()