(Spelled like multiplug) The purpose of this module is to provide a dead simple plugin handler module. I wanted something:
- Capable of handling multiple plugins (and that's pretty obvious)
- Capable of handling multiple implementation of the same plugin
- Capable of handling multiple
pkg_resources.WorkingSet
-s... by itself - Easy to initialize in your pluggable application/framework.
I wanted somthing like:
content_types = multipla.power_up('scriba.content_types')
def to_json(object):
content_type = content_types.get('application/json')
return content_type.format(ojbect)
def to_user_supplied_type(object, content_type):
return content_types.get(content_type).format(object)
or:
from loremipsum import generator
import multipla
samples = multipla.power_up('loremipsum.samples')
vaporware = generator.Generator(samples.get('vaporware'))
You can read more on Pythonhosted or Read the Docs. Since this package has en extensive docstring documentation as well as code comments, you can read more browsing the source code or in the python interactive shell.