CapabilitySpec#

class scikitplot.corpus.CapabilitySpec(name, role, module=None, distributions=(), assets_required=False, asset_probe=None, may_download=False, requires_network=False, remedy=None)[source]#

Declarative probe specification for one optional component.

A spec deliberately separates installation from readiness. A Python distribution can be installed while a model, corpus, executable, shared library, credential, or other runtime asset is still missing.

Parameters:
namestr

Stable capability identifier, for example "ocr:pytesseract".

rolestr

Human-readable role such as "ocr" or "asr".

modulestr or None, optional

Importable module used as a lightweight installation probe.

distributionstuple[str, …], optional

Distribution names used only for version/provenance discovery.

assets_requiredbool, optional

Whether usability depends on an asset beyond the Python package.

asset_probecallable or None, optional

Lightweight, side-effect-free probe. Return True when assets are ready, False when definitely missing, and None when readiness cannot be known without loading/downloading the component.

may_downloadbool, optional

Whether first use may download models/data.

requires_networkbool, optional

Whether normal operation requires network access.

remedystr or None, optional

User-facing guidance for the common unavailable case.

Parameters:

Notes

Probes must not download assets, initialise models, or contact the network. UNKNOWN is preferable to inventing readiness.

asset_probe: Callable[[], bool | None] | None = None#
assets_required: bool = False#
distributions: tuple[str, ...] = ()#
may_download: bool = False#
module: str | None = None#
name: str[source]#
remedy: str | None = None#
requires_network: bool = False#
role: str[source]#