find_properties method
Leave feedback
On this page
Finds metadata properties that satisfy the specified predicate, searching recursively through all nested packages.
Learn more:
- More examples demonstrating usages of this method: https://docs.groupdocs.com/display/metadatanet/Extracting+metadata
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.
result = {}
with Metadata(document_path) as metadata:
for prop in metadata.find_properties(lambda p: p.name is not None):
key = prop.name
value = (
str(prop.interpreted_value)
if prop.interpreted_value is not None
else (str(prop.value) if prop.value is not None else "")
)
result[key] = value
- class
MetadataPackage
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.