Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Aug 1, 2024
1 parent efde88d commit f8dc751
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions tests/webpub_manifest_parser/odl/test_semantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f8dc751

Please sign in to comment.