Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeon committed Dec 12, 2024
1 parent 971e255 commit f5f255f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions ocfl/inventory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
"""OCFL Inventory and Version.
The Inventory class provides storage for inventory data and mehtods to
conveniently access and manipulate it. The associated Version class provides
methods to access and manipulate information about a specific object version.
Neither of these classes interact with object content, see ocfl.NewVersion
and ocfl.Object.
The storage mechanism for the inventory data is the python dict()
structure resulting from reading the inventory JSON file and suitable
for writing an inventory JSON file. Here we provide convenient
Expand Down Expand Up @@ -91,7 +97,11 @@ class Inventory(): # pylint: disable=too-many-public-methods
attribute is a string that is not set in the underlying data, else
the value if it is. In the cases that the normal return value would
be an array or a dict, then and empty array or empty dict are returned
if not present in the underlying data.
if not present in the underlying data. In some cases, additional methods
with a suffix ``_add_if_not_present`` are provided so that assignements
will work for previously missing attributes. See, for example, the
``manifest`` property and the corresponding
``manifest_add_if_not_present()`` method.
Attributes:
data: dict that is the top level JSON object of the parsed JSON
Expand Down Expand Up @@ -559,9 +569,9 @@ def normalize_digests(self, digest_algorithm=None):
class Version():
"""Version class to represent version information in an Inventory.
The class stores only pointers to the appropriate inventory and
version directory with the versions block. These are used to access
data in the inventory.
The class stores only pointers to the appropriate ocfl.Inventory object
and the version directory key within the versions block. These are used
to access and manipulate data for a specific version in the inventory.
"""

def __init__(self, inv, vdir):
Expand Down

0 comments on commit f5f255f

Please sign in to comment.