Skip to main content

jaquette

PyPI Python CI License

Python client for the public MyBluray API (cover art and title search).

Non-commercial use only, as required by MyBluray and by this project's license. This project is not affiliated with MyBluray or DVDFr.

  • Synchronous (Client) and asynchronous (AsyncClient) clients with the same interface
  • Typed responses (pydantic) and a typed package (py.typed)
  • Search filters: media type, publisher, genre, release dates
  • Automatic retries with Retry-After support and exponential backoff
  • A clear exception hierarchy: one except JaquetteException catches everything
  • A jaquette command-line tool

Installation

pip install jaquette
# or
uv add jaquette

Python 3.11 or newer is required.

Quick start

from jaquette import Client

with Client() as client:
    # Cover art record by barcode (ISBN/EAN, as a string)
    product = client.get_product("3333290016961")
    print(product.title, product.media, product.editeur)

    # All editions of a title
    results = client.search("Breaking Bad")
    print(f"{len(results)} editions (truncated: {results.truncated})")
    for item in results:
        print(item.isbn, item.media, item.title)

The ISBN is a string: barcodes can start with zeros, which an integer would lose. Use the client as a context manager so the connection is closed for you.

Searching with filters

All filters are optional and keyword-only. media, editeur and genre accept a string or a list of strings.

Parameter Type Description
media str | list[str] Media type, e.g. "Blu-ray", ["DVD", "4K Ultra HD"]
editeur str | list[str] Publisher
genre str | list[str] DVDFr genre
parution_min date | "YYYY-MM-DD" Earliest release date
parution_max date | "YYYY-MM-DD" Latest release date
results = client.search(
    "Alien",
    media=["Blu-ray", "4K Ultra HD"],
    parution_min="2015-01-01",
)

Always check results.truncated: when it is True, not all DVDFr pages could be crawled and the list is incomplete.

Saving the barcode image

product.barcode holds the PNG bytes of the EAN-13 barcode:

from pathlib import Path

Path("barcode.png").write_bytes(product.barcode)

Asynchronous client

AsyncClient has the same methods, as coroutines:

import asyncio

from jaquette import AsyncClient


async def main() -> None:
    isbns = ["3333290016961", "3333290016962"]
    limit = asyncio.Semaphore(5)  # be polite: at most 5 requests at a time

    async with AsyncClient() as client:

        async def fetch(isbn: str):
            async with limit:
                return await client.get_product(isbn)

        # return_exceptions=True: one unknown barcode must not discard the others
        results = await asyncio.gather(*(fetch(i) for i in isbns), return_exceptions=True)

    for isbn, result in zip(isbns, results):
        print(isbn, result if isinstance(result, Exception) else result.title)


asyncio.run(main())

Command line

jaquette product 3333290016961
jaquette search Breaking Bad
jaquette search Alien --media Blu-ray --media "4K Ultra HD" --from 2015-01-01
jaquette search Alien --json
Option Applies to Description
--json product, search Print JSON instead of text (the barcode image is left out)
--media, --editeur, --genre search Filter; repeat the option to give several values
--from, --to search Release date bounds, YYYY-MM-DD

The exit code is 0 on success and 1 on error (the message goes to stderr).

Error handling

Every error raised by the library inherits from JaquetteException.

JaquetteException
├── InvalidISBNError         malformed ISBN (no request sent)
├── InvalidQueryError        query too short, or malformed date (no request sent)
├── NetworkError             connection failure or timeout, after retries
├── InvalidResponseError     the API response does not match the expected schema
└── APIError                 HTTP error (has .status_code, .message, .payload)
    ├── BadRequestError      400 / 422
    ├── NotFoundError        404
    ├── RateLimitError       429 (has .retry_after, in seconds)
    └── ServerError          5xx
from jaquette import Client, JaquetteException, NotFoundError

with Client() as client:
    try:
        product = client.get_product("9999999999999")
    except NotFoundError as e:
        print(f"Unknown barcode: {e.message}")
    except JaquetteException as e:
        print(f"Request failed: {e}")

Put the most specific except first.

Retries

Network errors, HTTP 429 and 502/503/504 are retried automatically, 2 times by default. The client waits for the Retry-After header when the server sends one (capped at 30 s), and otherwise waits 0.5 s, 1 s, 2 s... Other errors (404, 400...) are never retried.

Use Client(max_retries=0) to disable retries.

Design notes

  • One logic, two clients: validation, error mapping, parsing and retry delays are plain functions shared by Client and AsyncClient; only the network call differs.
  • Offline tests: the suite runs against httpx.MockTransport, never the real API.
  • Bring your own httpx client: Client(client=my_httpx_client) for proxies or custom transports.

Documentation

Full API reference: https://mtouzot.github.io/jaquette/

Development

uv sync
uv run pytest
uv run prek run --all-files
uv run mkdocs serve        # documentation preview

License

Released under the PolyForm Noncommercial License 1.0.0.

Metadata

Release files for jaquette 0.1.0

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

Source distribution (sdist)

Source distribution for jaquette 0.1.0
File Size Uploaded Provenance Actions
jaquette-0.1.0.tar.gz 13.9 kB Without provenance Details for jaquette-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jaquette 0.1.0
File Interpreter ABI Platform Actions
jaquette-0.1.0-py3-none-any.whl Python 3 none any Details for jaquette-0.1.0-py3-none-any.whl

Total release size: 29.7 kB

Release files / jaquette-0.1.0.tar.gz

Download URL jaquette-0.1.0.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fba88513bbf84c2dbfc5ef98de7edbfbf6741277e9f1429bcd304c19829f0942
BLAKE2b-256 checksum
How to use checksums
2e38c5fdea891019064fdf800a6275d3e510ef61fb149d7f5e331ee56170b368
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / jaquette-0.1.0-py3-none-any.whl

Download URL jaquette-0.1.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f80f2cf9428be900c2f9bf0bc7624f53871580b48422126ea1fd8898a11e218
BLAKE2b-256 checksum
How to use checksums
8f8d25ebd4016f37233a6be0dca9fdc05ad14981e42952fe7ae87872b31ae83a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for jaquette 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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