From f8dc751804b781fb09bcd5c37c894d49306d6267 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Thu, 1 Aug 2024 13:34:27 -0300 Subject: [PATCH] Code review feedback --- README.md | 20 +++++++++++++++++++ .../odl/test_semantic.py | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 861ccae..5410f4e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,26 @@ A parser for the [Open Publication Distribution System 2.0 (OPDS 2.0)](https://drafts.opds.io/opds-2.0), and [Open Distribution to Libraries 1.0 (ODL)](https://drafts.opds.io/odl-1.0.html) formats. +**Note**: This parser varys from the OPDS 2 + ODL spec in that it allows OPDS 2 + ODL feeds to contain +non-open access acquisition links. + +The spec [defines](https://drafts.opds.io/odl-1.0.html#21-opds-20) an OPDS 2 + ODL feed as: + +- It must be a valid OPDS Feed as defined in [[OPDS-2](https://drafts.opds.io/odl-1.0.html#normative-references)] with + one difference: + - The requirement for the presence of an Acquisition Link is relaxed + - Instead, each Publication listed in publications must either contain a licenses subcollection or an Open-Access + Acquisition Link (http://opds-spec.org/acquisition/open-access) + +The requirement that each link be an Open-Access Acquisition Link is overly restrictive, and prevents us from importing +mixed OPDS2 and OPDS2 + ODL feeds. We relax the requirement to: + +- It must be a valid OPDS Feed as defined in [[OPDS-2](https://drafts.opds.io/odl-1.0.html#normative-references)] with + one difference: + - The requirement for the presence of an Acquisition Link is relaxed + - Instead, each Publication listed in publications must either contain a licenses subcollection or an + **Acquisition Link** (http://opds-spec.org/acquisition) + ## Usage Install the library with `pip` diff --git a/tests/webpub_manifest_parser/odl/test_semantic.py b/tests/webpub_manifest_parser/odl/test_semantic.py index 3bfee84..7d9ef79 100644 --- a/tests/webpub_manifest_parser/odl/test_semantic.py +++ b/tests/webpub_manifest_parser/odl/test_semantic.py @@ -123,7 +123,7 @@ class ODLSemanticAnalyzerTest(AnalyzerTest): ], ), ( - "when_publication_does_not_contain_licenses_nor_acquisition_link", + "when_publication_contains_neither_licenses_nor_acquisition_link", ODLFeed( metadata=OPDS2FeedMetadata(title="test"), links=LinkList( @@ -155,7 +155,7 @@ class ODLSemanticAnalyzerTest(AnalyzerTest): ], ), ( - "when_publication_does_not_contain_licenses_nor_acquisition_link", + "when_publication_contains_neither_licenses_nor_acquisition_link", ODLFeed( metadata=OPDS2FeedMetadata(title="test"), links=LinkList(