Sphinx Lens
Structure-aware indexing and precise navigation for Sphinx documentation.
Sphinx knows things about your documentation that nothing downstream gets to
use: which text belongs to which section, that django.db.transaction.atomic is
a documented object with a canonical name, and where every cross-reference
points. Then it renders HTML and throws that away.
Sphinx Lens is a Sphinx builder that writes it down instead. The output is a single SQLite index of documents, sections, and domain objects, each with a stable reference and its own scoped text, plus the compiled link graph between them. Coding agents get to read one precise scope instead of grepping a source tree.
Each scope remains separately addressable. Consumers can retrieve the relevant part of the documentation without loading a whole-site text export or recovering structure from generated HTML.
Quick start
Install Sphinx Lens in the same environment as your documentation and build the index like any other Sphinx artifact:
sphinx-build -b lens docs/ docs/_build/lens/
sphinx-lens locate "connection timeout"
sphinx-lens inspect py:class:example.Client
sphinx-lens read guide/network#timeouts
sphinx-lens links guide/network#timeouts
The lens builder is discovered through Sphinx's builder entry point; no
conf.py change is required. It loads the project's formats, extensions, and
domains, then writes docs/_build/lens/index.sqlite. Query commands discover that
index from the repository root or anywhere inside the Sphinx source tree.
Run sphinx-lens build from the repository to discover conf.py and create the
index without spelling out the source directory.
Sphinx executes conf.py during every build. Only index projects you trust, and
run the command in the project's documentation environment so MyST, autodoc,
themes, and project-specific extensions are importable.
Install the bundled agent skill with Library Skills:
uvx library-skills install --skill sphinx-lens --yes
locate is lexical. It finds the right reference so that read and links can
do the real work; embedding similarity is out of scope.
Full documentation is at https://mgaitan.github.io/sphinx-lens/. Start with
Getting started, or read
How it works for why this is a separate artifact rather than a
reuse of objects.inv, searchindex.js, or Sphinx doctrees.
Development
- Install dependencies with
uv sync. - New dependency releases are delayed by one week via
uvcooldown ([tool.uv].exclude-newer = "1 week"), with per-package overrides when required (for example,ty). - Make targets and GitHub Actions enable uv's malware check against known malicious-package advisories.
- Install
prekas an external tool:
uv tool install prek
- Install git hooks with
prek:
prek install
- Run the local QA bundle with
prek:
prek run --all-files
- PRs with documentation changes publish a docs preview at:
https://mgaitan.github.io/sphinx-lens/_preview/pr-<PR_NUMBER>/
- Build this project's own index with
make lens, and the docs withmake docs.
Metadata
Release files for sphinx-lens 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sphinx_lens-0.3.0.tar.gz | 24.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinx_lens-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.1 kB
Release files / sphinx_lens-0.3.0.tar.gz
| Download URL | sphinx_lens-0.3.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d67453ddae461458ec3d4b9cb32d4401b1c76e69178f96a1642be65aec5f184
|
|
BLAKE2b-256 checksum How to use checksums |
fb34a713b43be1d894d52f890c5855b70c2f53171f1dc969bd8d14646aeb65ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / sphinx_lens-0.3.0-py3-none-any.whl
| Download URL | sphinx_lens-0.3.0-py3-none-any.whl |
|---|---|
| Size | 27.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85543f3aeaf661415a976da9fbd8a5735c923118252d4474c891b4a99434579f
|
|
BLAKE2b-256 checksum How to use checksums |
9315c11750b2991c8e01d83c4aed69a391e9fe42424bc62fded296a53609c1cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logSecurity for sphinx-lens 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for sphinx_lens-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.