Skip to main content

A parser for the Readium Web Publication Manifest, OPDS 2.0 and ODL formats.

Project description

webpub manifest parser

Run Tests PyPI Code style: black Imports: isort pre-commit Python: 3.8,3.9,3.10,3.11

A parser for the Readium Web Publication Manifest (RWPM), Open Publication Distribution System 2.0 (OPDS 2.0), and Open Distribution to Libraries 1.0 (ODL) 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 an OPDS 2 + ODL feed as:

  • It must be a valid OPDS Feed as defined in [OPDS-2] 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] 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

pip install palace-webpub-manifest-parser

Pyenv

You can optionally install the python version to run the library with using pyenv.

  1. Install pyenv

  2. Install one of the supported Python versions:

    pyenv install <python-version>
    
  3. Install pyenv-virtualenv plugin

  4. Create a virtual environment:

    pyenv virtualenv <virtual-env-name>
    pyenv activate <virtual-env-name>
    
  5. Install the library

    pip install palace-webpub-manifest-parser
    

Setting up a development environment

Running tests using tox

  1. Make sure that a virtual environment is not activated and deactivate it if needed:

    deactivate
    
  2. Install tox and tox-pyenv globally:

    pip install tox tox-pyenv
    
  3. Make your code prettier using isort and black:

    pre-commit run -a
    
  4. To run the unit tests use the following command:

    tox -e <python-version>
    

    where <python-version> is one of supported python versions:

    • py38
    • py39
    • py310
    • py311

    For example, to run the unit test using Python 3.9 run the following command:

    tox -e py39
    

Releasing

Releases will be automatically published to PyPI when new releases are created on github by the release.yml workflow. Just create a release in github with the version number that you would like to use as the tag, and the rest will happen automatically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

palace_webpub_manifest_parser-4.0.0.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file palace_webpub_manifest_parser-4.0.0.tar.gz.

File metadata

File hashes

Hashes for palace_webpub_manifest_parser-4.0.0.tar.gz
Algorithm Hash digest
SHA256 fb24ac59682e0ca7272fa55a04f905eb3f10a7c1948a3ad260a1e2eb9dacd0ac
MD5 18c4f7bec576d41b96baa01b7a6735a7
BLAKE2b-256 28be670b2f14b85fac241c778d9aa89db7db6b27a1730475028cf556958d5fac

See more details on using hashes here.

File details

Details for the file palace_webpub_manifest_parser-4.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for palace_webpub_manifest_parser-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b7f98c259cbd63d4515da80bdb9c387a7ef109162f38de1935bd5cba5aad345
MD5 a4070ae8a0c1273a09bed44ee03bc4f5
BLAKE2b-256 4a109f1a6186a9143b60a76890fe6a731dceca3c0fd9ba0e6ccf81e817540767

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page