Python Plugin Manager.
Py Plugin Manager
A slightly different take on a Python Plugin Manager for python 3.
What is a plugin?
- Well, strictly, it's a component that adds a specific feature to a program. But for Py Plugin Manager, this concept is a bit less strict.
- PPM allows any python file be loaded and reloaded dynamically.
How does PPM differ from other Plugin Managers?
- Currently, no changes need to be made to the module or code you wish to import.
- Unlike some other Plugin Managers, no configuration (aka .plugin) files need to be created.
Best Practices (so far)
- Separate your plugins into a separate directly, so that they are not mixed in with your application code.
- If your plugins require access to other modules that are not within the plugin directory, make sure that the sys.path is pointing to those directories so that your plugin's can successfully import those modules.
What is Py Plugin Manager?
PPM allows you to quickly load in a Python module, and be able to (reasonably) easily access variables, functions, constants, etc from those modules.
>>>test = PyPluginMgr.PlugInMgr(plugin_dir=r".\plugins", allow_creation=True, plug_ext=".py")
At this point all the .py files in .\plugins will be loaded and placed in the plugin catalog. At this point there are several ways to access the plugin contents:
Indirectly accessing the plugin name space (via get)
>>>test.get("pyfile1", "test")("this is an example of calling a function via get")
test, this is an example of calling a function via get
Directly access the plugin name space (via get_plugin)
>>>activeplugin = test.get_plugin("pyfile1")
<module 'pyfile1.py' from '....\\PluginMgr\\plugins\\pyfile1.py'>
>>>activeplugin.test("hello from Test!")
test, hello from Test!
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size PyPluginMgr-0.501-py3-none-any.whl (5.5 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size PyPluginMgr-0.501.tar.gz (4.2 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for PyPluginMgr-0.501-py3-none-any.whl