XmpPackage class

XmpPackage class

Represents base abstraction for XMP package.

Learn more:

The XmpPackage type exposes the following members:

Constructors

Constructor Description
init Initializes a new XMP package with the specified prefix and namespace URI.

Methods

Method Description
clear Removes all XMP properties.
get_xmp_representation Converts the XMP value to the XML representation.
remove Removes the property with the specified name.
remove_file
remove_string
set Sets a string property.
set Sets an integer property.
set Assigns a boolean XMP metadata property.
set Sets an XMP metadata property.
set Sets a double property.
set Sets the value inherited from XmpValueBase.
set Assigns a value to the specified XMP metadata property.
set Sets the value inherited from XmpArray.
set_file
set_string
add_properties Adds known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well. (inherited from MetadataPackage)
add_properties_func (inherited from MetadataPackage)
contains Returns True if the package contains a metadata property with the specified name; otherwise, False. (inherited from MetadataPackage)
contains_file (inherited from MetadataPackage)
contains_string (inherited from MetadataPackage)
find_properties Finds metadata properties that satisfy the specified predicate, searching recursively through all nested packages. (inherited from MetadataPackage)
find_properties_func (inherited from MetadataPackage)
get (inherited from MetadataPackage)
get_enumerator Returns an enumerator that iterates through the collection. (inherited from MetadataPackage)
get_file (inherited from MetadataPackage)
get_string (inherited from MetadataPackage)
remove_properties Removes metadata properties satisfying the specified predicate. (inherited from MetadataPackage)
remove_properties_func (inherited from MetadataPackage)
sanitize Removes writable metadata properties from the package, recursively affecting all nested packages. (inherited from MetadataPackage)
set_properties Sets known metadata properties satisfying the specified predicate. (inherited from MetadataPackage)
set_properties_func (inherited from MetadataPackage)
update_properties Updates known metadata properties that satisfy the specified predicate, recursively affecting all nested packages. (inherited from MetadataPackage)
update_properties_func (inherited from MetadataPackage)

Properties

Property Description
namespace_uri The namespace URI.
prefix The XML namespace prefix.
xml_namespace The XML namespace.
count The number of metadata properties. (inherited from MetadataPackage)
keys The collection of metadata property names. (inherited from MetadataPackage)
know_property_descriptors The collection of descriptors that contain information about properties accessible through the GroupDocs.Metadata search engine. (inherited from MetadataPackage)
metadata_type The metadata type of the package. (inherited from MetadataPackage)
property_descriptors The collection of descriptors that contain information about properties accessible through the GroupDocs.Metadata search engine. (inherited from MetadataPackage)

Example

from datetime import date

from groupdocs.metadata import Metadata
from groupdocs.metadata.standards.xmp import XmpArray, XmpArrayType, XmpPackage, XmpPacketWrapper


def add_custom_xmp_package():
    with Metadata("input.jpg") as metadata:
        root = metadata.get_root_package()
        packet = XmpPacketWrapper()

        custom = XmpPackage("gd", "https://groupdocs.com")
        custom.set("gd:Copyright", "Copyright (C) 2026 GroupDocs. All Rights Reserved.")
        custom.set("gd:CreationDate", date.today())
        custom.set("gd:Company", XmpArray.from_(["Aspose", "GroupDocs"], XmpArrayType.ORDERED))
        packet.add_package(custom)

        root.xmp_package = packet
        metadata.save("output.jpg")

See Also