Python database

David M. Cooke cookedm+news at physics.mcmaster.ca
Thu Mar 11 22:58:31 CET 2004


At some point, "@(none)" <""daniel\"@(none)"> wrote:

> Facts:
>
> (1) I don't know anything about data bases
>
> (2) I don't have much time to learn about them (but I do have SOME time)
>
> (3) I need to store (and retrieve) thousands of pages for a wiki, and
> need to be able to perform simple searches in the data base (but
> nothing else)
>
> (4) I want to have open source free of charge programs

The original Wiki at http://c2.com/cgi/wiki uses the filesystem as
its database (see http://c2.com/cgi/wiki?MoreAboutTheDatabase).
You can get ideas by looking at what other people have done at
http://c2.com/cgi/wiki?WikiWikiClones

There's a small Wiki clone in Python at
http://sourcefrog.net/projects/piki/
which MoinMoin is based on. It's filesystem based also. I use a custom
version of this for my personal use.

You don't need much of a database. You can probably get away with
one-page-per-file, maybe with an external indexer (like Lupy?). Have a
look at the speed of the original wiki; a full-text search of 26738
pages takes a few seconds -- and it's a cgi script.

> Can someone recommend a simple, easy-to-program data base? As far as I
> have understood there is no standard data base in Python. Why is this
> so? Do people have too different needs?

There are database modules in the standard Python distribution, just
not relational databases. Look at the anydbm, gdbm, and shelve
modules. Also look at the bsddb module, which is a wrapper around the
Berkeley DB library.

The TCL wiki (http://wiki.tcl.tk/) uses Metakit, which is another
non-relational database (although not included with Python), for which
there are Python wrappers.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list