
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.