[Catalog-sig] Would PyPI be a welcome place for Blogofile plugins?

P.J. Eby pje at telecommunity.com
Thu Feb 10 04:08:40 CET 2011


At 06:40 PM 2/9/2011 -0500, Ryan McGuire wrote:
>The
>idea is to wrap this content in a Python module and retrieve this
>content via pkg_resources.

Just as an FYI, the suggested approach for something like this would 
be to bundle the data under the project's .egg-info, and use the 
pkg_resources.metadata_* APIs to access them.  In this way, you don't 
have to make any fake Python packages or modules to install and 
access the data.  You only need modules if the plugin does in fact 
contain code.

See the EggTranslations project for an example of doing this with i18n plugins:

   http://chandlerproject.org/Projects/EggTranslations

(Indeed, if you plan for plugins' resources to be translatable, you 
may simply want to use EggTranslations as your resource lookup mechanism.)

Also as an FYI, pkg_resources includes APIs that are intended to make 
it easy to find and load plugins from designated plugin directories, e.g.:

   http://peak.telecommunity.com/DevCenter/PkgResources#locating-plugins




More information about the Catalog-SIG mailing list