ocfl.VersionMetadata

Metadata for a specific version of OCFL Object’s content.

class ocfl.VersionMetadata(*, created=None, message=None, name=None, address=None, inventory=None, version=None)

Class for metadata for a specific version of an OCFL Object.

Instance variables:

id: identifier of object created: string of creation time message: string explaining version creation name: name string for author or agent creating version address: URI for author or agent creating version

__init__(*, created=None, message=None, name=None, address=None, inventory=None, version=None)

Initialize with direct arguments or via an inventory.

Parameters:
  • created – string of creation time

  • message – string explaining version creation

  • name – name string for author or agent creating version

  • address – URI for author or agent creating version

  • inventory – an Inventory object to initialize from, default None

  • version – the version directory name from which to extract the appropropriate version metadata from the inventory, else None. If not specified then the latest/head version metadata will be take from the inventory

as_dict()

Return dictionary object with version metedata.

Returns dict() created according to the inventory structure for information about a single version. If created is not set then will add the current datatime string.

from_inventory(inventory, version=None)

Initialize from an inventory dict or Inventory object.

Parameters:
  • inventory – Inventory object or data dict

  • version – explicit version name to extract metadata from, else extract from the inventory head version

Look for specific version directory version if specified, else return the head version if none specified. Will extract object id, created, message, and user data. Will not extract the any state information.