The following example demonstrates how to load a file from a local disk by passing its path to the Metadata constructor.
fromgroupdocs.metadataimportMetadatadefload_from_local_disk():# Absolute or relative path to your documentwithMetadata("input.docx")asmetadata:# Extract, edit or remove metadata hereinfo=metadata.get_document_info()print(f"Loaded {info.file_type.file_format} ({info.size} bytes)")if__name__=="__main__":load_from_local_disk()
input.docx is the sample file used in this example. Click here to download it.