Skip to main content

Py Plugin Manager

A slightly different take on a Python Plugin Manager for python 3.

Introduction

  • 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.

For example:

    >>>import PyPluginMgr
    >>>test = PyPluginMgr.PlugInMgr(plugin_dir=r".\plugins", allow_creation=True, plug_ext=".py")
    >>>test.findcandidate_files()

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:

  1. Indirectly accessing the plugin name space (via get)
    >>>test.get("pyfile1", "__email__")
    'Benjamin@Schollnick.net'
    >>>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```
    
  2. Directly access the plugin name space (via get_plugin)
    >>>activeplugin = test.get_plugin("pyfile1")
    >>>activeplugin
    <module 'pyfile1.py' from '....\\PluginMgr\\plugins\\pyfile1.py'>
    >>>activeplugin.__name__
    'pyfile1.py'
    >>>activeplugin.test("hello from Test!")
    test,  hello from Test!
    

Release files for PyPluginMgr 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyPluginMgr 1.0.2
File Size Uploaded
PyPluginMgr-1.0.2.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyPluginMgr 1.0.2
File Interpreter ABI Platform
PyPluginMgr-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / PyPluginMgr-1.0.2.tar.gz

Download URL PyPluginMgr-1.0.2.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1675ad223fd1a1f7872c0c14a631a94272ca9032fb2cef5f912d2b51df5c3bfd
BLAKE2b-256 checksum
How to use checksums
ca39f37cb6123bdbcd1c238bd11a784c65a49cfb52af4de840fe706fb5a33fa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

Release files / PyPluginMgr-1.0.2-py3-none-any.whl

Download URL PyPluginMgr-1.0.2-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5c58e1d9d32d08db5eb0c45e0c88d539d36449627065ae01d4c476dad4e2af2
BLAKE2b-256 checksum
How to use checksums
c67787d3ae03de25cace28438bb90947f00060872ea7b337fa3a48f5523f08a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.501

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page