Registry / serialization / sphobjinv

sphobjinv

JSON →
library2.4pypypi✓ verified 84d ago

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.

pip install sphobjinv
INSTALL
IMPORT
SIG · SPHOBJINV
S
sphobjinv
serializationpythonv2.4
Install
2.5s avg
Import
321ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.346s · 22.2MB
glibc
py 3.103.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
Debug
Known issues
breakingIn v2.0, the API was overhauled: Inventory class replaced old inv module, many functions renamed. Code written for v1.x is not compatible.
fix
Use Inventory class from top-level sphobjinv. Refer to migration guide in docs.
affects: >=2.0,<2.0
gotchaRemote 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.
fix
Set the environment variable REQUESTS_CA_BUNDLE to a custom CA bundle, or use a local file path instead of URL.
affects: >=2.4
gotchaInventory objects are lazily loaded from URL; iteration or len() triggers download and parsing. That may delay first access.
fix
Call inv.load() explicitly if you want tight control over download timing.
affects: all
Errors
Common errors & fixes
KeyError: 'project'
Trying to access inv.project before the inventory has been fully loaded (lazy load).
fix
Call 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.
fix
Set 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.
fix
Use: 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)
Agent activity
4 hits · last 30 days
node
4
Resources
sphobjinv — pip install sphobjinv · libregistry