A function to test each metadata property for a condition.
Returns: int: The number of affected properties.
Example
fromgroupdocs.metadataimportMetadatafromgroupdocs.metadata.commonimportMetadataPropertyTypefromgroupdocs.metadata.taggingimportTagsdefremove_metadata_properties():# Remove all the properties satisfying the predicate:# the property carries the "author" tag, OR# the property carries the "last editor" tag, OR# the property is a string whose value equals "John"# (to wipe any mention of John from the detected metadata)withMetadata("input.docx")asmetadata:affected=metadata.remove_properties(lambdap:Tags.person.creatorinlist(p.tags)orTags.person.editorinlist(p.tags)or(p.value.type==MetadataPropertyType.STRINGandstr(p.value)=="John"))print(f"Properties removed: {affected}")metadata.save("output.docx")