set_properties method
Leave feedback
On this page
Sets known metadata properties satisfying the specified predicate.
Please note that GroupDocs.Metadata implicitly checks the type of each filtered property. It’s impossible to set a property with a value having inappropriate type.
def set_properties(self, predicate, value):
...
| Parameter | Type | Description |
|---|---|---|
| predicate | Func[MetadataProperty, bool] |
A function to test each metadata property for a condition. |
| value | PropertyValue |
A new value for the filtered properties. |
Returns: int: The number of affected properties.
from datetime import datetime
from groupdocs.metadata import Metadata
from groupdocs.metadata.common import PropertyValue
from groupdocs.metadata.tagging import Tags
def set_metadata_properties():
with Metadata("input.vsdx") as metadata:
property_value = PropertyValue(datetime.now())
affected = metadata.set_properties(
lambda p: Tags.time.created in list(p.tags)
or Tags.time.modified in list(p.tags),
property_value,
)
print(f"Properties set: {affected}")
metadata.save("output.vsdx")
- 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.