This page is a part of Stuff by Lars M. Garshol.

Python snippets

This page is just a place where I put Python modules when they have grown to the point where they may be useful for others, but not far enough to actually turn into a full tool.

They are provided in the hope that they may be useful to someone, but I do not guarantee that they will be improved, that APIs will remain stable or anything else. If you modify/improve them, please send me the patches, so I can incorporate them. That way, others can benefit as well.

The scripts

This is a simple module that reads DBF files (FoxPro and DBase), with associated FPT files. It has only been used to read FoxPro files, but should be easy to modify to work with DBase as well.
This is a simple POP-server with a fairly clean internal design. It has backends to read mail from a couple of different formats, and there is also a separate user registry. It is currently single-threaded, but has actually been used.

This very simple module can speak the CDDBP protocol for getting audio CD information from CDDB servers. It does not support the complete level 1 of the protocol, but may one day be extended to do so.

Carey Evans has a simple module that can be used to compute a CDDB disc ID under Linux.


A simple CGI script for sending form input as email. Supports a hidden REQUIRED field, which can contain the names of the fields that need to be filled out for the form to be accepted.


This simple module can be used to track down circular references that cause memory leaks. It works by traversing the instance attributes of objects, treating your object structure as a graph and looking for circular references.

A module that speaks the DICT protocol used by dictionary servers.

Last update 2001-02-18.