Get the collection of property descriptors for the desired metadata package
Iterate through the extracted descriptors
fromgroupdocs.metadataimportMetadatadefgetting_known_property_descriptors():withMetadata("input.doc")asmetadata:root=metadata.get_root_package()# Not every package exposes document properties; guard for itdocument_properties=getattr(root,"document_properties",None)ifdocument_propertiesisnotNone:# Each descriptor describes a known property the package supportsfordescriptorindocument_properties.know_property_descriptors:print(descriptor.name)# property nameprint(descriptor.type)# value typeprint(descriptor.access_level)# read-only / read-write# Tags attached to the property (used by the search predicates)fortagindescriptor.tags:print(tag)print()if__name__=="__main__":getting_known_property_descriptors()
input.doc is the sample file used in this example. Click here to download it.
Not all possible properties are present in the know_property_descriptors collection. The library provides information on the most frequently used properties only. If there is no descriptor for some property, it is still accessible through the GroupDocs.Metadata search engine in read-only mode.