This project has been archived by its maintainers, and is no longer receiving any updates.
webpub manifest parser
🚨 ARCHIVED 🚨: This package has been archived, and is no longer maintained. Palace Manager has been updated to use Pydantic instead of this parsing library. See Palace Manager for more information.
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.
-
Install pyenv
-
Install one of the supported Python versions:
pyenv install <python-version>
-
Install pyenv-virtualenv plugin
-
Create a virtual environment:
pyenv virtualenv <virtual-env-name> pyenv activate <virtual-env-name>
-
Install the library
pip install palace-webpub-manifest-parser
Setting up a development environment
Running tests using tox
-
Make sure that a virtual environment is not activated and deactivate it if needed:
deactivate
-
Install
toxandtox-pyenvglobally:pip install tox tox-pyenv
-
Make your code prettier using isort and black:
pre-commit run -a
-
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.
Metadata
Release files for palace_webpub_manifest_parser 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| palace_webpub_manifest_parser-4.1.0.tar.gz | 36.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| palace_webpub_manifest_parser-4.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.4 kB
Release files / palace_webpub_manifest_parser-4.1.0.tar.gz
| Download URL | palace_webpub_manifest_parser-4.1.0.tar.gz |
|---|---|
| Size | 36.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a51444e6a2cd60ba5625e40ea42dcde222e6a5ef11db55c36b47a007d72ad2b0
|
|
BLAKE2b-256 checksum How to use checksums |
e8032c9a2a82b33b77f466c2341811dc73de666a5d48f2826fee9439d5aca58e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.9.20 Linux/6.5.0-1025-azure
|
Release files / palace_webpub_manifest_parser-4.1.0-py3-none-any.whl
| Download URL | palace_webpub_manifest_parser-4.1.0-py3-none-any.whl |
|---|---|
| Size | 47.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
266ca8a813ce0feed3b4436d6f5c232da0ff0c8d366417ae37b5ae81319c872d
|
|
BLAKE2b-256 checksum How to use checksums |
f54929cfaf2a065a8704ab7b7b92819278aefbe8845e9f475ac09b32e21bf069
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.9.20 Linux/6.5.0-1025-azure
|