List of objects X Database

Pierre Quentel quentel.pierre at wanadoo.fr
Wed Oct 3 16:58:53 EDT 2007


On 3 oct, 22:01, MindMaster32 <egerm... at gmail.com> wrote:

Hi,

Maybe PyDbLite (http://quentel.pierre.free.fr/PyDbLite/index.html) is
what you need : a single Python module, compatible with Python 2.3+,
that lets you manipulate data in memory

You can manage a database like this :

import PyDbLite
db = PyDbLite.Base("dummy")
db.create("record,"artist","released") # fields are untyped
db.insert("Closer","Joy Division",1980)
db.insert("Different Class","Pulp",1996)
db.commit() # save to disk
print [ r for r in db if r["released"] > 1990 ]
print db(artist="Joy Division")

Regards,
Pierre




More information about the Python-list mailing list