organizing collections of small modules

Jorge Godoy jgodoy at gmail.com
Sun Mar 25 13:45:18 EDT 2007


"Eric S. Johansson" <esj at harvee.org> writes:

> I have a bunch of small modules that I use within my application.  Most of
> these modules are single file modules.  Currently, I have them set up as
> stand-alone modules but because it's a royal pain to fetch five or 10 of these
> modules for each application and tracking whether or not they are all up to
> date, I'm considering putting them all into one collection (rcsoc
> a.k.a. random cross-section of code[1]) so it's easier to load, install, and
> manage.
>
> Are there better techniques for managing collections of modules in 2.4 or
> later?
>
> ---eric
>
>
> [1]  derives from the expression that hamburger is "random cross-section of
> cow"

I'm using setuptools for that.  If they're somehow connected --
e.g. mathematics, database, finance, etc. -- then I create one single package
for them.  If they aren't, then creating several packages isn't hard.

If they are useful enough you can publish them on PyPI and then it is just a
matter of "easy_install" them.  If they aren't then you'll have to collect
them somewhere to use easy_install ;-)

It also supplies means to determine the minimum / maximum / exact version that
is required, so this also helps with how up-to-date your library has to be to
be used with some application.


-- 
Jorge Godoy      <jgodoy at gmail.com>



More information about the Python-list mailing list