Skip to main content

palace-opds

Pydantic models for the OPDS and Readium family of specifications used in digital-library publishing — read, validate, and emit feed and license documents with type-safe Python objects.

What's covered

  • OPDS 2.0 publication and feed documents, including facets, navigation groups, and publication groups.
  • Readium Web Publication Manifest (RWPM) — link models, presentation hints, encryption metadata.
  • OPDS for Distributors / Authentication for OPDS 1.0 — authentication documents and link relations.
  • ODL 1.0 (Open Distribution to Libraries) — license metadata, terms, protection, loan/checkout status.
  • LCP (Readium Licensed Content Protection) — license documents and loan-status (LSD) documents.
  • W3C accessibility metadata and schema.org publication vocabulary for the slices that OPDS feeds reference.
  • Palace-specific extensions to the publication metadata vocabulary (under palace.opds.palace) — these can be safely ignored if you don't need them.

Installation

pip install palace-opds   # or: uv add palace-opds

Requires Python 3.12+.

Quick example

from palace.opds.opds2 import PublicationFeed

feed = PublicationFeed.model_validate_json(raw_feed_bytes)
for publication in feed.publications:
    print(publication.metadata.title, publication.metadata.identifier)

Models live under the palace.opds namespace and follow Pydantic v2 conventions, so they serialize to/from JSON and dictionaries with .model_dump() / .model_validate().

Design

  • Spec-faithful, not opinionated. Where the OPDS / Readium specs allow flexibility, the models accept it; we don't impose application-specific constraints.
  • Lean dependencies. Only the validation and serialization libraries the models actually need (pydantic, pycountry, uritemplate) — no web framework, ORM, or cloud SDK is pulled in transitively.
  • Stable, documented breakage. Breaking changes follow semver and are called out in release notes; minor releases are additive.

Project context

palace-opds is developed and maintained as part of the Palace Project, where it powers OPDS ingestion and feed generation for the Palace Manager digital-library backend. It's published as a standalone package because the OPDS specs are widely shared — other library systems, ingestion pipelines, or research tools that work with OPDS feeds can use these models without taking on Palace Manager as a dependency.

Outside contributions and bug reports are welcome via the ThePalaceProject/circulation repository, where this package is developed as a uv workspace member.

License

Apache 2.0.

Download files

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

Source Distribution

palace_opds-45.1.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

palace_opds-45.1.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file palace_opds-45.1.0.tar.gz.

File metadata

  • Download URL: palace_opds-45.1.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for palace_opds-45.1.0.tar.gz
Algorithm Hash digest
SHA256 0122dc587cb727e9104008ab6f6e99879d849b5b949923818c60826f6d53307a
MD5 ff67ada8d1c1a3caf5d9c8c6716425c5
BLAKE2b-256 0e536d748b9efdf4ffa77034b4dfa26a0049c2b69b2dc04bdfc70174f83763ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for palace_opds-45.1.0.tar.gz:

Publisher: publish-pypi.yml on ThePalaceProject/circulation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file palace_opds-45.1.0-py3-none-any.whl.

File metadata

  • Download URL: palace_opds-45.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for palace_opds-45.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88b58c76d67ac59f1ea269ea711436155bbfa551638c86febb5a2a5c83a39720
MD5 bf6eb959733b83de8dba86ee973dd8d2
BLAKE2b-256 1e57c12c29732a1106d4e544b5542bdf37bb51d19ae52cad63b2549e7eaf118d

See more details on using hashes here.

Provenance

The following attestation bundles were made for palace_opds-45.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on ThePalaceProject/circulation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

45.3.0

2 files

45.2.0

2 files

This release

45.1.0 This release

2 files

45.0.0

2 files

44.0.5

2 files

44.0.4

2 files

44.0.3

2 files

44.0.2

2 files

44.0.1

2 files

44.0.0

2 files

43.1.1

2 files

43.1.0

2 files

43.0.2

2 files

43.0.1

2 files

43.0.0

2 files

42.0.0

2 files

41.1.1

2 files

41.1.0

2 files

41.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page