
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
simple-plugin-loader
Advanced tools
This module provides a simple way to dynamically load other Python modules as Plugins to your current project.
You can install this python module via pip:
pip install simple-plugin-loader
Otherwise the module can be downloaded from PyPI: https://pypi.org/project/simple-plugin-loader/
from simple_plugin_loader import Loader
# initialize the loader
loader = Loader()
# load your plugins
plugins = loader.load_plugins(<plugin_path>, <plugin_base_class>, <specific_plugins>, <recursive>)
plugins
property of the loader instance:
plugins = loader.plugins
load_plugins(...)
MethodThis method does the actual plugin loading.
It loads only Python modules that can be executed in the current environment. For every successfully loaded module a message is populated through the Python logging
library (log level: INFO
).
If a module e.g. contains syntax errors or depends on other not installed Python modules, it will be skipped. So the main program does not fail completely. An error message is populated through the Python logging
library (log level: ERROR
).
<plugin_path>
: str<plugin_base_class>
: class (Default: SamplePlugin
)SamplePlugin
class. You can use this class as the base class for your plugins:
from simple_plugin_loader.sample_plugin import SamplePlugin
class YourPlugin(SamplePlugin):
pass
<specific_plugins>
: List[str] (Default: []
)<plugin_base_class>
will also be ignored, so any class can be loaded.<recursive>
: bool (Default: False
)True
if you wish to load plugins/modules recursively to the above directory.The method returns a dictionary that has the following structure:
FAQs
Dynamically load other python modules to your project.
We found that simple-plugin-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.