Install & Compatibility
Where this runs
tested against v2.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.346s · 22.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.5s · import 0.296s · 22MB
20MB installed
● package 20MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Inventory
✓ from sphobjinv import Inventory
✗ from sphobjinv.inv import Inventory
Pre-v2.0 used a different module layout; now Inventory is directly importable from the top-level package.
DataObjStr
✓ from sphobjinv import DataObjStr
Quick example: load a remote Sphinx objects.inv and inspect it.
from sphobjinv import Inventory
# Load a remote inventory (e.g., from Python docs)
url = "https://docs.python.org/3/objects.inv"
inv = Inventory(url=url)
print(f"Loaded {len(inv.objects)} objects from {inv.project}")
# Convert to JSON and print first object
data = inv.json()
print(data[:100])
sphobjinv --version
Errors
Common errors & fixes
KeyError: 'project'
Trying to access inv.project before the inventory has been fully loaded (lazy load).
fixCall inv.load() first, or access after invoking a property that triggers load: len(inv) or list(inv.objects).
requests.exceptions.SSLError: HTTPSConnectionPool(host='...')
Default requests SSL verification fails due to corporate proxy or custom CA.
fixSet environment variable REQUESTS_CA_BUNDLE to the appropriate CA bundle path, or use a local file path for the inventory.
ModuleNotFoundError: No module named 'sphobjinv.inv'
Importing from obsolete module path.
fixUse: from sphobjinv import Inventory
Upgrade
Version history
2.4latest on PyPI · released Mar 23, 2026
Audit
Dependencies
certifirequiredHTTPS certificate validation for remote inventory fetching
jsonschemarequiredJSON schema validation for inventory JSON format
sphinxoptionalCLI tool to generate objects.inv (optional if only inspecting existing inventories)