grim/pyscovery

Added a README.txt

2013-03-23, Gary Kramlich
a10d04aa9b0c
Parents 351bdca2848c
Children 125cc32415f6
Added a README.txt
  • +35 -0
    README.txt
  • --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/README.txt Sat Mar 23 04:09:30 2013 -0500
    @@ -0,0 +1,35 @@
    +pyplugin is a Python plugin loader that will search for classes based from a
    +list of modules and optionally use the file system to recurse into packages.
    +
    +This is different from pkg_resources and friends since it doesn't require you
    +to add every module that might have packages, it will discover it for you.
    +
    +I wrote this because none of the existing solutions fit my need of being able
    +to logically group similar plugins in the filesystem.
    +
    +Say you have the following structure in your project:
    +
    + module/
    + __init__.py
    + plugin.py
    + plugins/
    + __init__.py
    + plugin1/
    + __init__.py
    + plugin2/
    + __init__.py
    + plugin3.py
    +
    +With pyplugin, the following code will find plugins 1, 2, and 3 for you:
    +
    + import pyplugin
    +
    + from plugins import Plugin
    +
    + pyplugin.add_module('plugins')
    + for plugin in pyplugin.find(Plugin, recurse=True):
    + print plugin
    +
    +Recursion in the filesystem is off by default, since that's the way people are
    +used to. If there is enough demand, I will make it the default.
    +