Skip to content

Commit

Permalink
Add example in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeon committed Oct 21, 2024
1 parent 065c8e3 commit 74e6f2f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ocfl/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ class Object(): # pylint: disable=too-many-public-methods
True
>>> validator.spec_version
'1.1'
>>> inv = object.parse_inventory() # parsed JSON as dict
>>> inv['digestAlgorithm']
'sha512'
>>> inv['versions']['v1']
{'created': '2018-01-01T01:01:01Z',
'message': 'Initial import', 'state':
{'7dcc352...7785947ac31': ['foo/bar.xml'],
'cf83e135...27af927da3e': ['empty.txt'],
'ffccf6ba...336cbfb862e': ['image.tiff']},
'user': {'address': 'mailto:[email protected]', 'name': 'Alice'}}
"""

def __init__(self, *, identifier=None, content_directory='content',
Expand Down

0 comments on commit 74e6f2f

Please sign in to comment.