Skip to main content

OPDS Client

opds-client

A Python library for working with OPDS catalogs, supporting both OPDS 1.2 (Atom/XML) and OPDS 2.0 (JSON) specifications.

PyPI version PyPI downloads Python 3.10+ License: MIT CI - Mainline CI - Features Code style: ruff

Features · Installation · Quick Start · Authentication · Models · Usage Examples · OPDS 1.2 vs OPDS 2.0 · Testing · Documentation · Project Structure · License


Features

OPDS 2.0 (JSON)

  • ✅ Parse OPDS 2.0 feeds and publications
  • ✅ Validate against OPDS 2.0 specification
  • ✅ Navigate navigation, publications, groups, and facets collections
  • ✅ Handle pagination (first, previous, next, last links)
  • ✅ Search catalogs with URI template resolution
  • ✅ Work with acquisition links (download, buy, borrow, etc.)
  • ✅ HTTP error handling with retries
  • ✅ Pydantic models for type safety

OPDS 1.2 (Atom/XML)

  • ✅ Parse OPDS 1.2 Atom feeds and entries
  • ✅ Dublin Core metadata support
  • ✅ Navigation and Acquisition feeds
  • ✅ Facet groups with active facets and item counts
  • ✅ Acquisition links with prices and indirect acquisitions
  • ✅ OpenSearch integration
  • ✅ Multiple acquisition relations (buy, borrow, subscribe, etc.)

Installation

pip install opds-client

Quick Start

OPDS 2.0 (JSON)

from opds_client import OPDS2Client

# Create a client
client = OPDS2Client()

# Fetch a feed
feed = client.fetch_feed("https://example.com/opds")

# Access feed metadata
print(f"Title: {feed.metadata.title}")
print(f"Publications: {len(feed.publications or [])}")

# Navigate navigation links
for nav in feed.navigation or []:
    print(f"- {nav.title}: {nav.href}")

# Search
results = client.search(feed, "query")

OPDS 1.2 (Atom/XML)

from opds_client import OPDS12Client

# Create a client for OPDS 1.2
client = OPDS12Client()

# Fetch a feed (XML format)
feed = client.fetch_feed("https://example.com/opds.xml")

# Access feed metadata
print(f"Title: {feed.title}")
print(f"Entries: {len(feed.entries or [])}")

# Navigate navigation links
start_link = feed.get_start_link()

# Get acquisition links from entries
if feed.entries:
    entry = feed.entries[0]
    acq_links = entry.get_acquisition_links()

Documentation

The full documentation is available at: https://sevdani.github.io/opds-client

Testing

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=opds_client

# Run type checks
mypy opds_client

# Run linter
ruff check .

Building Documentation Locally

# Install docs dependencies
pip install -e ".[docs]"

# Build with Zensical
zensical build

# Preview with Zensical
zensical serve

License

License: MIT

MIT License - see LICENSE file for details.

References

Metadata

Release files for opds-client 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opds-client 1.1.1
File Size Uploaded Provenance Actions
opds_client-1.1.1.tar.gz 25.8 kB With provenance Details for opds_client-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opds-client 1.1.1
File Interpreter ABI Platform Actions
opds_client-1.1.1-py3-none-any.whl Python 3 none any Details for opds_client-1.1.1-py3-none-any.whl

Total release size: 55.1 kB

Release files / opds_client-1.1.1.tar.gz

Download URL opds_client-1.1.1.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9b6c2a94f6f97b2604f1c978e827ee373ce7c62c49c169af47f3127395b13d4e
BLAKE2b-256 checksum
How to use checksums
b63ce97b63aee0b6b2d96ad10734b18c602bf22ef822a632c7d8a2e8cfa25e2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / opds_client-1.1.1-py3-none-any.whl

Download URL opds_client-1.1.1-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6099dc800645dade1919a1bca37558c5dc01aa7634f599f11b5b5fdb675b3db1
BLAKE2b-256 checksum
How to use checksums
9abd3519590bfd8d3fb2b34edc45af74a547be792061e6f75638abf124a4c615
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for opds-client 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for opds_client-1.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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