ResourcePackage 1.0.0a2 available...

Mike C. Fletcher mcfletch at
Mon Jan 13 17:45:24 CET 2003

ResourcePackage is a mechanism for automatically managing resources 
(i.e. non-Python files: small images, documentation files, binary data) 
embedded in Python modules (as Python source code), particularly for 
those wishing to create re-usable Python packages which require their 
own resource-sets.

ResourcePackage allows you to set up resource-specific sub-packages 
within your package.  It creates a Python module for each resource 
placed in the resource package's directory during development.  You can 
set up these packages with a simple file-copy and then use the resources 
saved/updated in the package directory like so:

    from mypackage.resources import open_icon
    result = myStringLoadingFunction( )

ResourcePackage scans the package-directory on import to refresh module 
contents, so simply saving an updated version of the file will make it 
available the next time your application is run.

When you are ready to distribute your package, you need only replace the 
copied file with a dummy to disable the scanning support and 
eliminate all dependencies on resourcepackage (that is, your users do 
not need to have resourcepackage installed once this is done).  Users of 
your packages do not need to do anything special when creating their 
applications to give you access to your resources, as they are simply 
Python packages/modules included in your package's hierarchy.  Your 
package's code (other than the mentioned doesn't change.

Note: there is code in resource package to allow you to manually refresh 
your package directories w/out copying in  I haven't yet 
wrapped that as a script, but intend to for the 1.0 release. 
 ResourcePackage is currently in 1.0 alpha status, it appears to work 
properly, but it has only had minimal testing.  You can get the 
distribution from the project page at:

I'm interested in any bug reports, enhancement requests or comments.

Enjoy all,
Mike Fletcher

  Mike C. Fletcher
  Designer, VR Plumber, Coder

More information about the Python-list mailing list