skill.registry¶
Generic plugin registry with entry point discovery.
Classes
|
A name-keyed registry of typed objects with lazy entry point discovery. |
- class skill.registry.Registry(name, *, entry_point_group=None)[source]¶
Bases:
MutableMapping,Generic[T]A name-keyed registry of typed objects with lazy entry point discovery.
Each
Registrywraps a dict and can auto-discover plugins registered viaimportlib.metadataentry points under the groupskill.<registry_name>.>>> r = Registry('demo') >>> r['foo'] = 42 >>> r['foo'] 42 >>> list(r) ['foo'] >>> len(r) 1 >>> del r['foo'] >>> len(r) 0