bsddb for simple database [very basic]

Al Gonzalez alberto at
Mon Aug 27 22:44:10 CEST 2001

Not really an answer to your question about bsddb, but rather a suggestion.

Metakit is a very simple to use database that is more powerful than the
db modules.

example (from their docs):
import metakit
db ="",1)
Create a view (this is the MetaKit term for "table"):
vw = db.getas("people[first:S,last:S,shoesize:I]"
Add two rows (this is the MetaKit term for "record"):
Commit the changes to file:
Show a list of all people:
for r in vw: print r.first, r.last, r.shoesize
Show a list of all people, sorted by last name:
for r in vw.sort(vw.last): print r.first, r.last, r.shoesize
Show a list of all people with first name 'John':
for r in'John'): print r.first, r.last, r.shoesize

"Artur Skura" <arturs at> wrote in message
news:slrn9oit5s.b5f.arturs at
> I need very simple database functionality for a weblog.
> (Most things generally available are very heavy, require
> Potgres/MySQL/PHP/whatever - this one will be just a little boa+a couple
> of cgi scripts, very flexible and easy to maintain).
> I thought about using one of the standard db modules, like bsddb. (First
> thing i have found is that documentation is quite scarce. I've seen some
> examples of using marshal with bsddb, but this seems like too much now.)
> I need to set up a simple database:
> * key
> * name
> * date
> * comment
> What is the simplest way to do that?
> ...

More information about the Python-list mailing list