Python Wrapper for the Collection Component


-> How to get things running

The PyCollection module which can be found in contrib area of POOL's CVS repository provides a "fat" python binding to the ICollection implementation interface and the "IMultiCollection" interface. On top of this binding tools for copying, transforming (e.g. MySQL <-> ROOT),  extracting collection subsets, managing the hierarchy of multi collections ...  can be easily realized.

The python interface is similar to the ICollection c++ interface, but there are some differences:
In the PyCollection/doc directory two very simple examples can be found:
  1. The first example demonstrates the extraction of a list of needed data base files for a specific job from an event collection.
  2. The second example shows how to extract small job event collections from one huge event collection.
Example code can also be found in PyCollection/test/unitTest_Basic.py

Of course the PyCollection can be used interactively. Documentation is provided via the Python dir and help functions:

pcepsft01 PyCollection/tests > python
Python 2.2.2 (#1, Feb  8 2003, 12:11:31)
[GCC 3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Collection import *
>>> dir()
['Collection', 'CollectionError', 'CollectionIterator', 'ObjectIterator', 'TESTTOKEN', 'Token', '__builtins__', '__doc__', '__name__', 'loadLibrary', 'setDefaultFileCatalogForRootCollections']
>>> help(Collection)



How to get things running:

  1. If a Pool release later than POOL_1_4_0 is already available just follow these instructions to build a local Pool working area.
  1. cd into the src directory:
  2. Checkout the latest version of the PyCollection Package, e.g.:
cvs co -r PyCollection-0-0-0 -d PyCollection pool/contrib/PyCollection
  1. scram b
  2. eval `scram runtime -csh` ; rehash
  3. cd PyCollection/tests/
  4. python unitTest_Basic.py
  5. python ../doc/example01.py
  6. python ../doc/example02.py

Author(s): Helmut Schmuecker