Using GroupDocs.Metadata you can extract the metadata properties you need from files of different types. You don’t have to worry about the exact file format or the metadata standards it uses — the same code works for all supported formats. Most commonly used metadata properties are marked with tags, and all tags are grouped into categories that make it easier to find the one you need. The code sample below demonstrates how to use tags, categories and other property attributes.
Load a file to search for metadata properties
Build a predicate to examine every extracted metadata property
Pass the predicate to the find_properties method
Iterate through the found properties
fromgroupdocs.metadataimportMetadatafromgroupdocs.metadata.taggingimportTagsdefextracting_metadata():withMetadata("input.docx")asmetadata:# Find every property whose tags fall into the "content" categoryproperties=metadata.find_properties(lambdap:any(tag.category==Tags.contentfortaginp.tags))forpropinproperties:print(f"Property name: {prop.name}, Property value: {prop.value}")if__name__=="__main__":extracting_metadata()
input.docx is the sample file used in this example. Click here to download it.