httk.core.docs.inventories

Read and validate Sphinx intersphinx v2 inventory headers.

Exceptions

InventoryError

Raised when an inventory cannot be fetched or has unexpected metadata.

Functions

read_inventory_header(→ tuple[str, str])

Return project and version from the plain-text inventory header.

fetch_inventory(→ tuple[str, str])

Fetch an inventory from HTTP(S) or file://, validate it, and save it.

Module Contents

exception httk.core.docs.inventories.InventoryError[source]

Bases: RuntimeError

Raised when an inventory cannot be fetched or has unexpected metadata.

httk.core.docs.inventories.read_inventory_header(path_or_bytes: str | pathlib.Path | bytes) tuple[str, str][source]

Return project and version from the plain-text inventory header.

httk.core.docs.inventories.fetch_inventory(url: str, dest: str | pathlib.Path, *, expected_project: str | None = None, expected_version: str | None = None) tuple[str, str][source]

Fetch an inventory from HTTP(S) or file://, validate it, and save it.