httk.core.docs.inventories ========================== .. py:module:: httk.core.docs.inventories .. autoapi-nested-parse:: Read and validate Sphinx intersphinx v2 inventory headers. Exceptions ---------- .. autoapisummary:: httk.core.docs.inventories.InventoryError Functions --------- .. autoapisummary:: httk.core.docs.inventories.read_inventory_header httk.core.docs.inventories.fetch_inventory Module Contents --------------- .. py:exception:: InventoryError Bases: :py:obj:`RuntimeError` Raised when an inventory cannot be fetched or has unexpected metadata. .. py:function:: read_inventory_header(path_or_bytes) Return project and version from the plain-text inventory header. :param path_or_bytes: Inventory file path or its contents. :return: Project and version declared by the inventory. :raises InventoryError: If the inventory does not have the expected header. .. py:function:: fetch_inventory(url, dest, *, expected_project = None, expected_version = None) Fetch an inventory from HTTP(S) or ``file://``, validate it, and save it. :param url: HTTP(S) or ``file://`` URL of the inventory. :param dest: Destination path for the validated inventory. :param expected_project: Required project header, when supplied. :param expected_version: Required version header, when supplied. :return: Project and version declared by the fetched inventory. :raises InventoryError: If fetching, validation, or saving the inventory fails.