find_properties method

find_properties

Finds metadata properties that satisfy the specified predicate, searching recursively through all nested packages.

Learn more

def find_properties(self, predicate):
    ...
Parameter Type Description
predicate Func[MetadataProperty, bool] A function to test each metadata property for a condition.

Returns: Iterable[MetadataProperty]: An iterable containing properties from the package that satisfy the condition.

Example

from groupdocs.metadata import Metadata
from groupdocs.metadata.tagging import Tags

def find_metadata_properties():
    with Metadata("input.pptx") as metadata:
        properties = metadata.find_properties(
            lambda p: Tags.person.editor in list(p.tags)
            or Tags.time.modified in list(p.tags)
        )
        for prop in properties:
            print(f"Property name: {prop.name}, Property value: {prop.value}")

See Also