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.
Features · Installation · Quick Start · Authentication · Models · Usage Examples · OPDS 1.2 vs OPDS 2.0 · Testing · 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()
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 .
License
MIT License - see LICENSE file for details.
References
Metadata
Release files for opds-client 1.0.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 | Provenance | Actions |
|---|---|---|---|---|
| opds_client-1.0.0.tar.gz | 25.9 kB | With provenance | Details for opds_client-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opds_client-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for opds_client-1.0.0-py3-none-any.whl |
Total release size: 55.2 kB
Release files / opds_client-1.0.0.tar.gz
| Download URL | opds_client-1.0.0.tar.gz |
|---|---|
| Size | 25.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a414f8e67c42f67eb71b8d50add82fd03a2ef6d4670725a0b9ed5b51026cffea
|
|
BLAKE2b-256 checksum How to use checksums |
cc44cb2405f9d8dd40aff0a27704f7495f98a63143a2e86230d0f9863d25b4df
|
| 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 logRelease files / opds_client-1.0.0-py3-none-any.whl
| Download URL | opds_client-1.0.0-py3-none-any.whl |
|---|---|
| Size | 29.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a38bbc1dcd45808afa3b4845aba076668c862fb9f7553f7eb54612b5510ce8a
|
|
BLAKE2b-256 checksum How to use checksums |
c2d8a1a04091b63155011fef8092ce3d5d9fa06c0d474cdbe82d67d42a2db251
|
| 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 logSecurity for opds-client 1.0.0
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.
Attestation for opds_client-1.0.0.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 logA 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.