Skip to content

Commit

Permalink
Merge branch 'main' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeon committed Dec 5, 2024
2 parents 883f1e5 + a5d8152 commit d918b64
Show file tree
Hide file tree
Showing 35 changed files with 999 additions and 297 deletions.
6 changes: 5 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ functions.
.. toctree::
:maxdepth: 1

ocfl
ocfl.object
ocfl.storage_root
ocfl.inventory
ocfl.version
ocfl.inventory_validator
ocfl.version_metadata
ocfl.new_version
ocfl.constants
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
# Autodoc
autodoc_default_options = {
"autoclass_content": "both", # doesn't work to show __init__ docs??
'special-members': '__init__' # get __init__ to show explicitly
"special-members": "__init__" # get __init__ to show explicitly
}
30 changes: 21 additions & 9 deletions docs/demo_using_bagit_bags.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/t
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v2/bagit.txt
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v2/bag-info.txt
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v2/manifest-sha512.txt
INFO:root:Will update info:bb123cd4567 v1 -> v2
INFO:root:Updated OCFL object info:bb123cd4567 in tmp/obj by adding v2
### <ocfl.version_metadata.VersionMetadata object at 0x7fb92132e6e0>
Updated object info:bb123cd4567 to v2
```


Expand Down Expand Up @@ -102,8 +103,9 @@ INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/t
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v3/bagit.txt
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v3/bag-info.txt
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v3/manifest-sha512.txt
INFO:root:Will update info:bb123cd4567 v2 -> v3
INFO:root:Updated OCFL object info:bb123cd4567 in tmp/obj by adding v3
### <ocfl.version_metadata.VersionMetadata object at 0x7f1bba34a6e0>
Updated object info:bb123cd4567 to v3
```


Expand Down Expand Up @@ -147,8 +149,9 @@ INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/t
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v4/bagit.txt
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v4/bag-info.txt
INFO:bagit:Verifying checksum for file /home/runner/work/ocfl-py/ocfl-py/tests/testdata/bags/uaa_v4/manifest-sha512.txt
INFO:root:Will update info:bb123cd4567 v3 -> v4
INFO:root:Updated OCFL object info:bb123cd4567 in tmp/obj by adding v4
### <ocfl.version_metadata.VersionMetadata object at 0x7f37a7dfe6e0>
Updated object info:bb123cd4567 to v4
```


Expand All @@ -161,13 +164,12 @@ Taking the newly created OCFL object `/tmp/obj` we can `--extract` the `v4` cont
INFO:root:Extracted v4 into tmp/extracted_v4
INFO:bagit:Creating bag for directory tmp/extracted_v4
INFO:bagit:Creating data directory
INFO:bagit:Moving my_content to tmp/extracted_v4/tmpp2zau7cu/my_content
INFO:bagit:Moving tmp/extracted_v4/tmpp2zau7cu to data
INFO:bagit:Moving my_content to tmp/extracted_v4/tmpt_h62tn4/my_content
INFO:bagit:Moving tmp/extracted_v4/tmpt_h62tn4 to data
INFO:bagit:Using 1 processes to generate manifests: sha512
INFO:bagit:Generating manifest lines for file data/my_content/dracula.txt
INFO:bagit:Generating manifest lines for file data/my_content/dunwich.txt
INFO:bagit:Generating manifest lines for file data/my_content/poe-nevermore.txt
INFO:bagit:Generating manifest lines for file data/my_content/another_directory/a_third_copy_of_dracula.txt
INFO:bagit:Creating bagit.txt
INFO:bagit:Creating bag-info.txt
INFO:bagit:Creating tmp/extracted_v4/tagmanifest-sha512.txt
Expand All @@ -184,14 +186,24 @@ We note that the OCFL object had only one `content` file in `v4` but the extract
diff -r tmp/extracted_v4/bag-info.txt tests/testdata/bags/uaa_v4/bag-info.txt
1,2c1
< Bag-Software-Agent: bagit.py v1.8.1 <https://github.com/LibraryOfCongress/bagit-python>
< Bagging-Date: 2024-11-06
< Bagging-Date: 2024-12-05
---
> Bagging-Date: 2020-01-04
7c6
< Payload-Oxum: 1032810.3
---
> Payload-Oxum: 1915970.4
Only in tests/testdata/bags/uaa_v4/data/my_content: another_directory
diff -r tmp/extracted_v4/manifest-sha512.txt tests/testdata/bags/uaa_v4/manifest-sha512.txt
3a4
> ffc150e7944b5cf5ddb899b2f48efffbd490f97632fc258434aefc4afb92aef2e3441ddcceae11404e5805e1b6c804083c9398c28f061c9ba42dd4bac53d5a2e data/my_content/another_directory/a_third_copy_of_dracula.txt
diff -r tmp/extracted_v4/tagmanifest-sha512.txt tests/testdata/bags/uaa_v4/tagmanifest-sha512.txt
2c2
< 175cfaadd50d9f8c0c9b0e8bd4049be9bf83f286598d5c60e23c6d5be8dd1a937eab03ea188ffcc95e1737c27012f58a7c289c62645168ec5a682f028763b784 bag-info.txt
2,3c2,3
< ba0f77d695226f32ef316aa1c0000a13d8f78b6948a5415a3e11a95f73153ecf351c91211a5e7b20ab6b785ec472ec5fcc6e8e6fb5a3e718ea86d7719cd3c690 bag-info.txt
< e4cb52067909ba58668f21c0da72c73c586a3f87d64b471187cb6234ed605d17974e4c7833f6ae7e639ab1126502534b3bed4cfeee8cba485cfc764b48225e0f manifest-sha512.txt
---
> 10624e6d45462def7af66d1a0d977606c7b073b01809c1d42258cfab5c34a275480943cbe78044416aee1f23822cc3762f92247b8f39b5c6ddc5ae32a8f94ce5 bag-info.txt
> 5c2e2b9cacc93cb315d57f09fac6d199c3378313b6cf918bb0a70e1839c4e4c0c2e5a7f9ae869cf7755e09a196a835be1af7c510d3d5faa5d0c0b3f6be9f816a manifest-sha512.txt
```

(last command exited with return code 1)
Expand Down
24 changes: 22 additions & 2 deletions docs/fixtures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@ Test Fixtures
=============

Official `OCFL Fixtures
<https://github.com/OCFL/fixtures>`_
<https://github.com/OCFL/fixtures>`_ include:

* OCFL v1.1

* Specification examples:

* Section `5.1 Minimal OCFL Object <https://ocfl.io/1.1/spec/#example-minimal-object>`_ is good

* Section `5.2 Versioned OCFL Object <https://ocfl.io/1.1/spec/#example-versioned-object>`_ is valid and has fixture object `1.1/good-objects/spec-ex-full <https://github.com/OCFL/fixtures/tree/main/1.1/good-objects/spec-ex-full>`_

* Section `5.3 Different Logical and Content Paths in an OCFL Object <https://ocfl.io/1.1/spec/#example-object-diff-paths>`_ is valid but should generate a warning because the ``message`` property is missing.

* OCFL v1.0

* Specification examples:

* Section `5.1 Minimal OCFL Object <https://ocfl.io/1.0/spec/#example-minimal-object>`_ is valid but should generate a warning because the ``address`` is not a URI

* Section `5.2 Versioned OCFL Object <https://ocfl.io/1.0/spec/#example-versioned-object>`_ is valid and has fixture object `1.0/good-objects/spec-ex-full <https://github.com/OCFL/fixtures/tree/main/1.0/good-objects/spec-ex-full>`_

* Section `5.3 Different Logical and Content Paths in an OCFL Object <https://ocfl.io/1.0/spec/#example-object-diff-paths>`_ is valid but should generate warnings because the ``message`` and the ``user`` ``name`` and ``address`` properties are missing.

Additions from `ocfl-py
<https://github.com/zimeon/ocfl-py/tree/main/extra_fixtures>`_
<https://github.com/zimeon/ocfl-py/tree/main/extra_fixtures>`_ are in the ``extra_fixtures`` directory
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ code, and additional test fixtures.

.. toctree::
:maxdepth: 2
:caption: Contents:

command_line
api
Expand Down
10 changes: 10 additions & 0 deletions docs/ocfl.constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
``ocfl.Constants``
==================

.. automodule:: ocfl.constants

.. autodata:: INVENTORY_FILENAME

.. autodata:: SPEC_VERSIONS_SUPPORTED

.. autodata:: DEFAULT_SPEC_VERSION
7 changes: 2 additions & 5 deletions docs/ocfl.inventory.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
``ocfl.inventory``
``ocfl.Inventory``
==================

.. automodule:: ocfl.inventory

.. autoclass:: Inventory
:members:

.. autoclass:: Version
.. autoclass:: ocfl.Inventory
:members:
7 changes: 7 additions & 0 deletions docs/ocfl.inventory_validator.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
``ocfl.InventoryValidator``
===========================

.. automodule:: ocfl.inventory_validator

.. autoclass:: ocfl.InventoryValidator
:members:
10 changes: 10 additions & 0 deletions docs/ocfl.new_version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
``ocfl.NewVersion``
===================

.. automodule:: ocfl.new_version

.. autoclass:: ocfl.NewVersion
:members:

.. autoclass:: ocfl.NewVersionException
:members:
4 changes: 2 additions & 2 deletions docs/ocfl.object.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
``ocfl.object``
``ocfl.Object``
===============

.. automodule:: ocfl.object

.. autoclass:: Object
.. autoclass:: ocfl.Object
:members:
5 changes: 0 additions & 5 deletions docs/ocfl.rst

This file was deleted.

9 changes: 6 additions & 3 deletions docs/ocfl.storage_root.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
``ocfl.storage_root``
=====================
``ocfl.StorageRoot``
====================

.. automodule:: ocfl.storage_root

.. autoclass:: StorageRoot
.. autoclass:: ocfl.StorageRoot
:members:

.. autoclass:: ocfl.StorageRootException
:members:
9 changes: 9 additions & 0 deletions docs/ocfl.version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
``ocfl.Version``
================

The ocfl.Version class is used only in conjunction with the ocfl.Inventory
class as it simply provides a convenient access point into the
data of an ocfl.Inventory.

.. autoclass:: ocfl.Version
:members:
7 changes: 7 additions & 0 deletions docs/ocfl.version_metadata.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
``ocfl.VersionMetadata``
========================

.. automodule:: ocfl.version_metadata

.. autoclass:: ocfl.VersionMetadata
:members:
Loading

0 comments on commit d918b64

Please sign in to comment.