The dumbdbm module

This is a very simple database implementation, similar to dbm and friends, but written in pure Python. It uses two files; a binary file (.dat) which contains the data, and a text file (.dir) which contain data descriptors.

The anydbm module uses this as the last choice.

Example: Using the dumbdbm module
# File:

import dumbdbm

db ="dumbdbm", "c")
db["first"] = "fear"
db["second"] = "surprise"
db["third"] = "ruthless efficiency"
db["fourth"] = "an almost fanatical devotion to the Pope"
db["fifth"] = "nice red uniforms"

db ="dumbdbm", "r")
for key in db.keys():
    print repr(key), repr(db[key])

$ python
'first' 'fear'
'third' 'ruthless efficiency'
'fifth' 'nice red uniforms'
'second' 'surprise'
'fourth' 'an almost fanatical devotion to the Pope'

A Django site. rendered by a django application. hosted by webfaction.