Thursday, July 2, 2009

PyUtilib Plugins

After blogging about Python plugin frameworks earlier this year, I wound up implemented a new framework in the PyUtilib software package.  The PyUtilib wiki provides a detailed description of the PyUtilib Plugin Framework, but here's a brief summary:
  • This framework is derived from the Trac plugin framework (a.k.a. component architecture)
  • Provides support for both singleton and non-singleton plugin instances
  • Includes utilities for managing plugins within namespaces
  • The core framework is defined in a single Python module, which can be used independently from PyUtilib
  • PyUtilib also includes commonly use plugins, such as
    • A config-file reader/writer based on ConfigParser
    • Loading utilities for eggs and modules
    • A file manager for temporary files
Although I initially resisted the urge to develop my own framework, I was led to develop this because (1) I wanted a light-weight framework like that provided by Trac, but (2) Trac's framework is not particularlly modular within the Trac software repository.  Also, I really needed a plugin framework that supported non-singleton plugins. Development of the PyUtilib Plugin Framework is mostly motivated by my work with Coopr, which extensively leverages plugins to support a flexible, extensible optimization tools.

No comments:

Post a Comment