eulxml.xmlmap.premis - PREMIS

eulxml.xmlmap classes for dealing with the PREMIS metadata format for preservation metadata.


class eulxml.xmlmap.premis.BasePremis(node=None, context=None, **kwargs)

Base PREMIS class with namespace declaration common to all PREMIS XmlObjects.

Note

This class is intended mostly for internal use, but could be useful when extending or adding additional PREMIS XmlObject classes. The PREMIS_NAMESPACE is mapped to the prefix p.

class eulxml.xmlmap.premis.Event(node=None, context=None, **kwargs)

Preliminary XmlObject for a PREMIS event.

Note

The PREMIS schema requires that elements occur in a specified order, which eulxml does not currently handle or manage. As a work-around, when creating a new Event from scratch, you should set the following required fields in this order: identifier (id and ad_type

date = <eulxml.xmlmap.fields.StringField>

date/time for the event (eventDateTime)

detail = <eulxml.xmlmap.fields.StringField>

event detail (eventDetail)

id = <eulxml.xmlmap.fields.StringField>

identifier value (eventIdentifier/eventIdentifierValue)

id_type = <eulxml.xmlmap.fields.StringField>

identifier type (eventIdentifier/eventIdentifierType)

outcome = <eulxml.xmlmap.fields.StringField>

outcome of the event (eventOutcomeInformation/eventOutcome).

Note

In this preliminary implementation, the outcome detail fields are not mapped.

type = <eulxml.xmlmap.fields.StringField>

event type (eventType)

class eulxml.xmlmap.premis.Object(node=None, context=None, **kwargs)

Preliminary XmlObject for a PREMIS object.

Curently only includes the minimal required fields.

id = <eulxml.xmlmap.fields.StringField>

identifier value (objectIdentifier/objectIdentifierValue)

id_type = <eulxml.xmlmap.fields.StringField>

identifier type (objectIdentifier/objectIdentifierType)

type = <eulxml.xmlmap.fields.StringField>

type of object (e.g., file, representation, bitstream).

Note

To be schema valid, object types must be in the PREMIS namespace, e.g.:

from eulxml.xmlmap import premis
obj = premis.Object()
obj.type = "p:file"
eulxml.xmlmap.premis.PREMIS_NAMESPACE = u'info:lc/xmlns/premis-v2'

authoritative namespace for PREMIS

eulxml.xmlmap.premis.PREMIS_SCHEMA = u'http://www.loc.gov/standards/premis/v2/premis-v2-1.xsd'

authoritative schema location for PREMIS

class eulxml.xmlmap.premis.Premis(*args, **kwargs)

Preliminary XmlObject for a PREMIS container element that can contain any of the other top-level PREMIS elements.

Curently only includes mappings for a single object and list of events.

events = <eulxml.xmlmap.fields.NodeListField>

list of PREMIS events, as instances of Event

object = <eulxml.xmlmap.fields.NodeField>

a single PREMIS object

version = <eulxml.xmlmap.fields.StringField>

Version of PREMIS in use; by default, new instances of Premis will be initialized with a version of 2.1

class eulxml.xmlmap.premis.PremisRoot(node=None, context=None, **kwargs)

Base class with a schema declaration for any of the root/stand-alone PREMIS elements: