{"id":22392,"library":"sphobjinv","title":"sphobjinv","description":"Sphinx objects.inv Inspection/Manipulation Tool. Version 2.4 (requires Python >=3.10). Enables introspection and modification of Sphinx inventories, including conversion to/from JSON, HTML, and Text. Last release: v2.4 (2025-04-01). Release cadence: irregular.","status":"active","version":"2.4","language":"python","source_language":"en","source_url":"https://github.com/bskinn/sphobjinv","tags":["sphinx","inventory","documentation","tool"],"install":[{"cmd":"pip install sphobjinv","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTPS certificate validation for remote inventory fetching","package":"certifi","optional":false},{"reason":"JSON schema validation for inventory JSON format","package":"jsonschema","optional":false},{"reason":"CLI tool to generate objects.inv (optional if only inspecting existing inventories)","package":"sphinx","optional":true}],"imports":[{"note":"Pre-v2.0 used a different module layout; now Inventory is directly importable from the top-level package.","wrong":"from sphobjinv.inv import Inventory","symbol":"Inventory","correct":"from sphobjinv import Inventory"},{"note":"","wrong":"","symbol":"DataObjStr","correct":"from sphobjinv import DataObjStr"}],"quickstart":{"code":"from sphobjinv import Inventory\n\n# Load a remote inventory (e.g., from Python docs)\nurl = \"https://docs.python.org/3/objects.inv\"\ninv = Inventory(url=url)\nprint(f\"Loaded {len(inv.objects)} objects from {inv.project}\")\n\n# Convert to JSON and print first object\ndata = inv.json()\nprint(data[:100])","lang":"python","description":"Quick example: load a remote Sphinx objects.inv and inspect it."},"warnings":[{"fix":"Use Inventory class from top-level sphobjinv. Refer to migration guide in docs.","message":"In v2.0, the API was overhauled: Inventory class replaced old inv module, many functions renamed. Code written for v1.x is not compatible.","severity":"breaking","affected_versions":">=2.0,<2.0"},{"fix":"Set the environment variable REQUESTS_CA_BUNDLE to a custom CA bundle, or use a local file path instead of URL.","message":"Remote inventory URLs must be HTTPS. HTTP is blocked in v2.4 due to certifi enforcement; fails with requests.exceptions.SSLError if using custom CA or proxies.","severity":"gotcha","affected_versions":">=2.4"},{"fix":"Call inv.load() explicitly if you want tight control over download timing.","message":"Inventory objects are lazily loaded from URL; iteration or len() triggers download and parsing. That may delay first access.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Call inv.load() first, or access after invoking a property that triggers load: len(inv) or list(inv.objects).","cause":"Trying to access inv.project before the inventory has been fully loaded (lazy load).","error":"KeyError: 'project'"},{"fix":"Set environment variable REQUESTS_CA_BUNDLE to the appropriate CA bundle path, or use a local file path for the inventory.","cause":"Default requests SSL verification fails due to corporate proxy or custom CA.","error":"requests.exceptions.SSLError: HTTPSConnectionPool(host='...')"},{"fix":"Use: from sphobjinv import Inventory","cause":"Importing from obsolete module path.","error":"ModuleNotFoundError: No module named 'sphobjinv.inv'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}