exiv2._properties

XMP key class and data attributes.

Classes

XmpCategory

Category of an XMP property.

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.

class XmpCategory

Bases: IntEnum

Category of an XMP property.

External = 1
Internal = 0
xmpExternal = 1
xmpInternal = 0
class XmpKey

Bases: SwigPyObject

Concrete keys for XMP metadata.

clone()
familyName()
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()
ns()

Return the schema namespace for the prefix of the key

tag()

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

tagDesc()
tagLabel()
tagName()
class XmpNsInfo

Bases: SwigPyObject

Structure mapping XMP namespaces and (preferred) prefixes.

desc_

Brief description of the namespace

items()

Get structure members.

Return type:

list of (str, value) tuple

Returns:

structure member (name, value) pairs (with any trailing underscores removed from names).

keys()

Get structure member names.

Return type:

list of str

Returns:

structure member names (with any trailing underscores removed).

ns_

Namespace

prefix_

(Preferred) prefix

values()

Get structure member values.

Return type:

list of value

Returns:

structure member values.

xmpPropertyInfo_

List of known properties

class XmpProperties

Bases: SwigPyObject

XMP property reference, implemented as a static class.

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.

desc_

Property description

items()

Get structure members.

Return type:

list of (str, value) tuple

Returns:

structure member (name, value) pairs (with any trailing underscores removed from names).

keys()

Get structure member names.

Return type:

list of str

Returns:

structure member names (with any trailing underscores removed).

name_

Property name

title_

Property title or label

typeId_

Exiv2 default type for the property

values()

Get structure member values.

Return type:

list of value

Returns:

structure member values.

xmpCategory_

Category (internal or external)

xmpValueType_

XMP value type (for info only)