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
Truewhen assets are ready,Falsewhen definitely missing, andNonewhen 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.
UNKNOWNis preferable to inventing readiness.