PyCool
PyCool is a python bindings package for COOL. PyCool allows full access to a COOL database via Python. It is part of the official COOL release since COOL_1_2_3.
The following is an example of how to use PyCool:
from PyCool import cool, coral
dbSvc = cool.DatabaseSvcFactory.databaseService()
print 'using software release', dbSvc.serviceVersion()
connectString = 'sqlite://;schema=COOLTEST.db;dbname=COOLTEST'
print 'recreating database'
dbSvc.dropDatabase( connectString )
db = dbSvc.createDatabase( connectString )
print 'setting up spec'
spec = cool.RecordSpecification()
spec.extend( 'i', cool.StorageType.Int32 )
data = cool.Record( spec )
data['i'] = 3
f = db.createFolder( "/folder", spec )
f.storeObject( 0, 5, data, 0 )
obj = f.findObject( 3, 0 )
print obj
Running this script will produce the output:
> python wiki.py
using software release 2.1.1
recreating database
setting up spec
[0,5[ (0) [i (Int32) : 3] 2007-04-22_14:21:48.565932000 GMT
--
SvenASchmidt - 14 Sep 2005