[Zope] Re: strategies for using external py packages

Tres Seaver tseaver at zope.com
Fri Oct 1 11:31:48 EDT 2004

Jim Abramson wrote:

> Can anyone recommend a good resource, online docs, examples that
> specifically deal with methods/best practices/caveats for using external
> python code libs within Zope.
> I have read the relevant chapters in Zope Book and done quite a bit of
> googling but can't seem to find detailed material on this.  My situation
> involves, on the one hand, a sizeable 'instance space' application, and
> on the other, some python modules/packages that I need to teach the
> instance-space stuff to use.  The instance app is too vast to
> realistically rewrite as a zope Product all in one shot - therefore I'm
> looking for a sane way to gradually add external functionality (and
> later, offload existing functionality from instance -> external).  What
> I'm most interested in is a discussion of External Methods vs. Products
> as a means for doing this, memory and performance considerations, etc.
> The external code should know nothing about Zope, ZODB etc - so I
> suspect what I need to design is essentially some sort of proxy layer.
> (If this isn't specific enough I can happily elaborate.)

Write a simple Zope product which provides a "façade" object for your 
package;  then add an instance of that object to your Zope, and have 
your templates / scripts use the external library through it.  In a CMF 
/ Plone application, such an object would be a "tool".

Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com

More information about the Zope mailing list