API Docs¶
Pythonic API for interacting with an OCFL storage root.
- class ocflcore.FileSystemStorage(root_path)[source]¶
File system storage.
Construct the file system.
- Parameters
root_path – Path to the storage root.
- class ocflcore.OCFLObject(object_id, content_directory='content', digest_algorithm='sha512', spec='1.1')[source]¶
Logical representation of an OCFL Object.
OCFL Object constructor.
- property content_directory¶
Get the content directory.
- property digest_algorithm¶
Get the digest algorithm.
- property head¶
Get the most recent version.
- property id¶
Get the object identifier.
- property spec¶
Get OCFL specification for this object.
- property version_numbers¶
Return a range of version numbers.
- property versions¶
Get the object identifier.
- class ocflcore.OCFLRepository(root, storage, workspace_storage=None)[source]¶
Repository for OCFL objects.
The repository takes care of reading and writing of OCFL objects in the OCFL storage root, as well as handling updates.
The class is named repository after the repository pattern in “Fowler (2002). Patterns of Enterprise Application Architecture”.
Constrcutor.
- class ocflcore.OCFLVersion(creation_time)[source]¶
Logical representation of a version.
Constructor.
- property created¶
Creation date.
- property files¶
Get the object identifier.
- property index¶
Get the version index.
- property message¶
Get the message.
- property state¶
Version state.
- property user¶
Get the message.
- class ocflcore.StorageLayout[source]¶
Base class for storage root hierarchies layouts.
- property data¶
Get a dictionary for the ocfl_layout.json file.
- property json_bytes¶
Get the JSON serialization of this storage root.
- class ocflcore.StorageRoot(layout, version='1.1')[source]¶
OCFL storage root representation.
Constructor.
- property human_text¶
Human readable text of the OCFL spec.
- property human_text_filename¶
Filename of the OCFL spec.
- property namaste¶
Name as text filename for this storage root.