puresnmp.plugins.pluginbase module

class puresnmp.plugins.pluginbase.Loader(namespace: str, validator: Callable[[ModuleType], bool])

Bases: object

create(name: Any) Any

Return an instance of the given privacy module by identifier.

This looks up the module by “IDENTIFIER” as specified in the given plugin.

If no plugin with the given identifier is found, a KeyError is raised

puresnmp.plugins.pluginbase.discover_plugins(namespace: str, is_valid_module: Callable[[ModuleType], bool]) Dict[Any, ModuleType]

Load all plugins in the given namespace (only if it is a valid module)

Module validity check is handed off to the is_valid_module callable. Any module that is not valid is silently skipped.