exiv2.properties

XMP key class and data attributes.

Inheritance diagram of exiv2.metadatum.Key

Enums

XmpCategory

Category of an XMP property.

Classes

XmpKey

Concrete keys for XMP metadata.

XmpNsInfo

Structure mapping XMP namespaces and (preferred) prefixes.

XmpProperties

XMP property reference, implemented as a static class.

XmpPropertyInfo

Information about one XMP property.

enum XmpCategory(value)

Bases: IntEnum

Category of an XMP property.

Member Type:

int

Valid values are as follows:

xmpInternal = <XmpCategory.xmpInternal: 0>
xmpExternal = <XmpCategory.xmpExternal: 1>
class XmpKey

Bases: Key

Concrete keys for XMP metadata.

__annotations__ = {}
clone()

Return an auto-pointer to a copy of itself (deep copy). The caller owns this copy and the auto-pointer ensures that it will be deleted.

familyName()

Return an identifier for the type of metadata (the first part of the key)

groupName()

Return the name of the group (the second part of the key). For XMP keys, the group name is the schema prefix name.

key()

Return the key of the metadatum as a string. The key is of the form ‘familyName.groupName.tagName’. Note however that the key is not necessarily unique, e.g., an ExifData may contain multiple metadata with the same key.

ns()

Return the schema namespace for the prefix of the key

tag()

Properties don’t have a tag number. Return 0.

tagDesc()

Return a description for the tag

tagLabel()

Return a label for the tag

tagName()

Return the name of the tag (which is also the third part of the key)

class XmpNsInfo

Bases: SwigPyObject

Structure mapping XMP namespaces and (preferred) prefixes.

__annotations__ = {}
__getitem__(key, /)

Return self[key].

__iter__()

Implement iter(self).

desc_

Brief description of the namespace

items()

Get structure members.

Return type:

tuple of (str, value) tuple

Returns:

structure member (name, value) pairs.

static keys()

Get structure member names.

Return the names used to access members as attributes (object.name) or with dict-like indexing (object['name']). Attribute access is preferred as it is more efficient.

Although the exiv2 C++ structure member names end with underscores, the Python interface uses names without underscores.

Return type:

tuple of str

Returns:

structure member names.

ns_

Namespace

prefix_

(Preferred) prefix

values()

Get structure member values.

Return type:

tuple of value

Returns:

structure member values.

xmpPropertyInfo_

List of known properties

class XmpProperties

Bases: SwigPyObject

XMP property reference, implemented as a static class.

__annotations__ = {}
static ns()

Return the namespace name for the schema associated with prefix.

Parameters:

prefix (str) – Prefix

Return type:

str

Returns:

The namespace name

Raises:

Exiv2Error if no namespace is registered with prefix.

static nsDesc()

Return the namespace description for the schema associated with prefix.

Parameters:

prefix (str) – Prefix

Return type:

string

Returns:

The namespace description

Raises:

Exiv2Error if no namespace is registered with prefix.

static nsInfo()

Return information about a schema namespace for prefix. Always returns a valid pointer.

Parameters:

prefix (str) – The prefix

Return type:

XmpNsInfo

Returns:

A pointer to the related information

Raises:

Exiv2Error if no namespace is registered with prefix.

static prefix()

Return the (preferred) prefix for schema namespace ns.

Parameters:

ns (str) – Schema namespace

Return type:

str

Returns:

The prefix or an empty string if namespace ns is not registered.

static propertyDesc()

Return the description of the property.

Parameters:

key (XmpKey) – The property key

Return type:

string

Returns:

The description of the property, 0 if the key is of an unknown property.

static propertyInfo()

Return information for the property for key.

If the key is a path to a nested property (one which contains a slash, like Xmp.MP.RegionInfo/MPRI:Regions), determines the innermost element (Xmp.MPRI.Regions) and returns its property information.

Parameters:

key (XmpKey) – The property key

Return type:

XmpPropertyInfo

Returns:

A pointer to the property information, 0 if the key is of an unknown property.

static propertyList()

Return read-only list of built-in properties for prefix.

Parameters:

prefix (str) – Prefix

Return type:

XmpPropertyInfo

Returns:

Pointer to the built-in properties for prefix, may be 0 if none is configured in the namespace info.

Raises:

Exiv2Error if no namespace is registered with prefix.

static propertyTitle()

Return the title (label) of the property.

Parameters:

key (XmpKey) – The property key

Return type:

string

Returns:

The title (label) of the property, 0 if the key is of an unknown property.

static propertyType()

Return the type for property key. The default for unknown keys is xmpText.

Parameters:

key (XmpKey) – The property key

Return type:

TypeId

Returns:

The type of the property

static registerNs()

Register namespace ns with preferred prefix prefix.

If the prefix is a known or previously registered prefix, the corresponding namespace URI is overwritten.

Note

This invalidates XMP keys generated with the previous prefix.

static registeredNamespaces()

Get all registered namespaces (for both Exiv2 and XMPsdk)

static unregisterNs()

Overload 1:

Unregister a custom namespace ns.

The function only has an effect if there is a namespace ns registered earlier, it does not unregister built-in namespaces.

Note

This invalidates XMP keys generated in this namespace.

Overload 2:

Unregister all custom namespaces.

The function only unregisters namespaces registered earlier, it does not unregister built-in namespaces.

Note

This invalidates XMP keys generated in any custom namespace.

class XmpPropertyInfo

Bases: SwigPyObject

Information about one XMP property.

__annotations__ = {}
__getitem__(key, /)

Return self[key].

__iter__()

Implement iter(self).

desc_

Property description

items()

Get structure members.

Return type:

tuple of (str, value) tuple

Returns:

structure member (name, value) pairs.

static keys()

Get structure member names.

Return the names used to access members as attributes (object.name) or with dict-like indexing (object['name']). Attribute access is preferred as it is more efficient.

Although the exiv2 C++ structure member names end with underscores, the Python interface uses names without underscores.

Return type:

tuple of str

Returns:

structure member names.

name_

Property name

title_

Property title or label

typeId_

Exiv2 default type for the property

values()

Get structure member values.

Return type:

tuple of value

Returns:

structure member values.

xmpCategory_

Category (internal or external)

xmpValueType_

XMP value type (for info only)