scverse_doc.registry#

The scverse package registry.

One mapping drives the “scverse packages” navbar dropdown, the per-package accent colour, and intersphinx_mapping.

Its data is scverse/ecosystem-packages’ published packages.json, the same listing the website renders, fetched once per build and cached. Only the accent colours are added here, because they live in the website’s SCSS instead.

scverse_doc.registry.packages: Mapping[str, Package] = <scverse_doc.registry.Packages object>#

Every registered package, keyed and ordered by case-folded name.

scverse_doc.registry.core_packages() Mapping[str, Package]#

Return only the core packages.

scverse_doc.registry.intersphinx(*extra: str, external: bool = True, core: bool = True) ChainMap[str, tuple[str, None]]#

Build an intersphinx_mapping for this package.

Every entry is an inventory fetched on every build, so the ecosystem is opt-in by name.

Parameters:
  • extra – Additional registry package names to include, e.g. intersphinx("scanpy", "muon"). Unknown names raise KeyError, ones without an inventory ValueError – on first access, not here, since a conf.py calls this before the extension is loaded.

  • external – Whether to include the non-scverse inventories (Python, NumPy, SciPy, pandas, Matplotlib).

  • core – Whether to include the core packages that publish an inventory.

Examples

>>> mapping = intersphinx("scanpy")
>>> mapping["scanpy"]
('https://scanpy.scverse.org/...', None)
class scverse_doc.registry.Package(name: str, kind: Literal['core', 'ecosystem'], docs: str, inventory: str | None = None, repo: str | None = None, description: str = '', accent: str = '#4557c4')#

One entry in the scverse package registry.

accent: str#

The package’s brand accent, falling back to the scverse primary.

description: str#

One-line summary, as recorded upstream.

docs: str#

Where to send a reader, verbatim from upstream – a link for humans, possibly not a docs root.

inventory: str | None#

Root URL under which objects.inv resolves, or None if the package publishes none.

kind: Literal['core', 'ecosystem']#

Whether the package is maintained by the core team or listed as an ecosystem package.

name: str#

The package’s display name, e.g. "scvi-tools".

repo: str | None#

URL of the source repository, if the upstream listing records one.

scverse_doc.registry.cache_dir: Path | None = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/scverse-doc/checkouts/latest/docs/_build/doctrees/__scverse__')#

Where the fetched listing is cached; None fetches every time. See build_cache().

scverse_doc.registry.build_cache(app: Sphinx) Path#

Point cache_dir at a directory inside the build and return it.

Call from setup, i.e. after conf.py ran: nothing may touch the registry before that – see intersphinx().