Skip to content

mitsuhiko/pluginbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2a5db4c · May 16, 2021

History

56 Commits
Mar 25, 2018
Oct 18, 2016
May 10, 2021
May 16, 2021
May 10, 2021
Jun 30, 2014
Jun 30, 2014
Jun 30, 2014
May 16, 2021
May 16, 2021
May 16, 2021
May 16, 2021
May 10, 2021

Repository files navigation

PluginBase

PluginBase is a module for Python that enables the development of flexible plugin systems in Python.

Step 1:

from pluginbase import PluginBase
plugin_base = PluginBase(package='yourapplication.plugins')

Step 2:

plugin_source = plugin_base.make_plugin_source(
    searchpath=['./path/to/plugins', './path/to/more/plugins'])

Step 3:

with plugin_source:
    from yourapplication.plugins import my_plugin
my_plugin.do_something_cool()

Or alternatively:

my_plugin = plugin_source.load_plugin('my_plugin')
my_plugin.do_something_cool()