04 April 2006 ~ 9 Comments

Making Python plugins easier

When I was working on my IRC bot, I wanted to make it as modular as possible so that other people could write plugins for it. Ideally someone could write a plugin, and after dropping it in a ‘modules’ directory, all the new functionality would be automagically added to the bot. Much like Supybot is able to do.

I ended up getting a system put together that pretty much did what I wanted. But I couldn’t help but thinking the whole time that this is a problem that has probably been solved before… and in far more elegant ways than my messy code.

Tonight I came across Sprinkles. It claims to be a “library to assist you in making your applications easily support plugins.” Sounds good. Unfortunately, I can’t quite navigate the author’s site to see exactly how development is going. And I’m always wary of making my applications depend on a library that some guy cranked out in an evening.

Update: Andy was kind enough to update his site with the SprinklesPy docs. If you need a plugin system for your Python app, check it out.

Update 2: It looks like you can do some interesting stuff when you add some Sprinkles to your web framework.

9 Responses to “Making Python plugins easier”

  1. Jeff Lindsay 4 April 2006 at 7:45 am Permalink

    Funny, I know the guy. He uses it quite often from what I hear. He’s very accessible… talk to him. :P

  2. Andy Smith 4 April 2006 at 7:59 am Permalink

    Hey there, sorry about being unable to navigate my site, I’ve been a bit lazy about fleshing out my wiki, and even actually updating the docs for this most recent version of sprinkles. But, since I am a sucker for attention, I’ll go clean that stuff up now and post another comment when it is … presentable.

  3. Andy Smith 4 April 2006 at 9:01 am Permalink

    Alright, here ya go: http://termie.pbwiki.com/SprinklesPy

  4. John 4 April 2006 at 7:47 pm Permalink

    Whoa, awesome!

    I certainly didn’t mean you had to update your website just because of me. :) But much appreciated. I’ll check that out this week (hopefully tonight)!

    Thanks,
    John

  5. John 4 April 2006 at 10:27 pm Permalink

    Got it installed tonight, but didn’t get a chance to try it out. I can import the module ok though. :)

    Maybe tomorrow.

  6. Kevin Dangoor 13 June 2006 at 5:24 am Permalink

    You should check out setuptools for doing plugins. It’s actually one of the major features of Python Eggs. If you take TurboGears widgets, for example, you can do:

    easy_install Lightbox
    tg-admin toolbox

    The first command installs the Lightbox and Scriptaculous widgets (because of dependencies). The second command will run the Toolbox which has a “widget browser”. Both Lightbox and Scriptaculous will show up there… no configuration needed. no dropping in special directories, either!


Leave a Reply