This example demonstrates how to load a file of a particular format. Explicitly specifying the format through LoadOptions can spare the time spent on automatic format detection.
fromgroupdocs.metadataimportMetadatafromgroupdocs.metadata.commonimportFileFormatfromgroupdocs.metadata.optionsimportLoadOptionsdefloading_file_of_specific_format():load_options=LoadOptions(FileFormat.SPREADSHEET)withMetadata("input.xlsx",load_options)asmetadata:root=metadata.get_root_package()# Use format-specific properties to extract or edit metadataprint(f"Author: {root.document_properties.author}")if__name__=="__main__":loading_file_of_specific_format()
input.xlsx is the sample file used in this example. Click here to download it.