Note: This is a really old page (mostly dating back to the mid-late 1990's), I'm leaving it here because there are some links pointing back to some of the things here. For newer stuff, see my github page at https://github.com/samrushing
Here are some links to software that I've written or ported.
reindent a python source file. you specify the indent string.
Built on a portable AVL tree library written in C. (included) This module implements an interesting builtin data structure for Python that combines the search and store efficiency of a balanced binary tree with the convenience and characteristics of an array.
An extension module useful for parsing and unparsing binary data structures. Somewhat like the standard struct module, but with a few extra features (bitfields, user-function-fields, byte order specification, etc...) and a different API more convenient for streamed and context-sensitive formats like network protocol packets, image and sound files, etc...
Includes a couple of sample parsers for PGP keyrings and GIF files. Heavily used by the fledgling win32 library included with the calldll package.
Companion to the GIF format parser mentioned above. A high-performance, re-entrant GIF LZW data decoder written as a Python extension module.
A syslog module implemented in Python. A little more flexible than the C version by Lance Ellinghouse, this one implements the syslog 'protocol' directly, and can log to remote hosts.
A simple, powerful framework for building custom SPAM filters. SpamWall is a filtering proxy daemon that sits between your site's SMTP server and the outside world. It is modular and extensible. Included are two sample filters - a regular-expression based filter (like procmail) and a 'blacklist' filter.
My Pride and Joy. A library for building asynchronous socket clients and servers. A single program can 'simultaneously' communicate with many other clients and servers, using and implementing multiple protocols, all running within a single address space, on a single thread. Sound like magic? Nah, it's just event-driven multiplexing. It's such a neat idea, that it's gotten its own 'pattern name': Reactor. Douglas C. Schmidt has written a paper on this, you can find it on his Design Patterns for Concurrent, Parallel, and Distributed Systems page. (No, I didn't invent the idea. I stole it from INN!)
I happen to think that Python is spectacularly well-suited for exploiting this idea. Medusa is a good showcase for the union.
Included in the library are sample clients, servers, and demonstrations for several internet protocols, including HTTP, finger, DNS, POP3, and FTP.
An Internet Server Platform built around the asynchronous sockets library. Out of the box, Medusa can run an unlimited number of HTTP and FTP servers within a single address space, without the use of threads. Capable of impressive hit-rates (Linux 486 dx/2 : ~66 HTTP hits/second, in about 1.5 megs of virtual memory), this server can solve your performance problems while handing you the most powerful server-side scripting language available.
Since Medusa is written entirely in Python, it is portable to any platform that implements the socket and select modules correctly. It has been tested on several Unix platforms, Windows NT, and Windows 95. It will probably even work on the Macintosh. [please contact me if you try this!]
Includes a monitor feature that lets you connect into the server while it is running, to enter and evaluate Python expressions (basically, a remote interpreter capability).
This uses Aaron Watters' kwParsing parser-generator package to construct a CORBA IDL parser in Python.
A robust rfc822 date parser based on code from INN and Emacs. Does its best to handle many different timezones
Yet Another Matrix Module. This one leans more toward the flexible end of the spectrum, sacrificing performance for correctness. For example, it can correctly handle rationals and other strange things being inserted into it. Also implemented: LU[P] decomposition, and a simultaneous linear equation solving capability. Most of the standard matrix ops: transpose, determinant, inverse, etc.. along with some functional-style methods for mapping and iteration.
>>> import matrix >>> h = matrix.hilbert(5) >>> h.determinant() Rat(1, 266716800000L) >>> h <matrix 1 1/2 1/3 1/4 1/5 1/2 1/3 1/4 1/5 1/6 1/3 1/4 1/5 1/6 1/7 1/4 1/5 1/6 1/7 1/8 1/5 1/6 1/7 1/8 1/9> >>> h.inverse() <matrix 25 -300 1050 -1400 630 -300 4800 -18900 26880 -12600 1050 -18900 79380 -117600 56700 -1400 26880 -117600 179200 -88200 630 -12600 56700 -88200 44100> >>>
<advertising mode>
Essentials of Programming Languages,
(Friedman, Wand, Haynes, McGraw-Hill 1992) is an incredible book.
Nothing I can say will do it justice. It is the best book on
programming languages and their implementation that I have ever read.
Through a very hands-on approach, you learn how to write
interpreters and compilers for languages that include a host of
relatively new and powerful features: first-class functions and
continuations, closures, proper tail-recursion, coroutines, dynamic
assignment, dynamic-wind, etc...
</advertising mode>
I have gone through the book, writing up the examples, implementing the interesting exercises, etc... but in Python rather than Scheme. I'm up to section 9.4 so far, and I've included all the code, divided up by chapter/section. Each of the interpreters is 'ready to run'. Here is a sample transcript from the interpreter.
This code could be especially useful to those who are unfamiliar with Scheme or Lisp: Although the book uses Scheme as the metalanguage, the concepts translate to many languages well, including Python.
Note:This code uses Aaron Watters' KwParsing module to to generate the parser for the ML-ish language used in the book.
I have written a tiny compiler/VM for Scheme. See here for more information
With this module you can call any function in any DLL. This means that you can do just about anything on Win32. Includes an (occasionally-resurrected) library that gives access to lots of the system GUI features. I have used this to build stand-alone Windows applications that are completely implemented in Python (including the Message Loop).
Includes a 'callback' generator for i386: this lets external functions call back into python as if it were C. (Much of the Win32 API uses callbacks).
Includes an ODBC module implemented using calldll, along with a few extra practical pieces; code for managing data sources, installing ODBC itself, and creating and maintaining Jet (Microsoft Access) databases. It's also been tested with ODBC drivers from Oracle and Objectivity.
Note: The calldll library has gotten quite large, and has been spun off into a separate distribution, called DynWin. DynWin is now a full-blown Win32 GUI development environment.
A Win32 version of the python freeze utility. With this you can build executables and DLL's that require only 'python14.dll' in order to run. These changes have been rolled into XFreeze for NT by Bill Tutt, available here
A few demonstration apps are also available: A 'parallel' ftp client, finger client, GIF file dumper, Windows NTP (Network Time Protocol) applet, and a POP3 mailbox system-tray app.)
Win32 port of the bsddb module.
Access to Win32's memory-mapping capabilities. (now included with the PythonWin distribution).
Access to the Win32 timer capability. (now included with the PythonWin distribution).
Print out a colorful two-dimensional Hilbert curve on your printer
Help python run as a subprocess in Emacs for python-mode.el on Win32. This is a calldll hack
System Tray POP3 mail notification for Windows 95/NT4
My Win32 port of Berkeley's DB library, version 1.85.
Note: This port has probably been superseded by DB Version 2, available from www.sleepycat.com.
Note: Robin Dunn has a new DB 2.X module for Python
A rapidly-hacked port of the patch utility for win32.
Quick port of the GNU memory allocation library.
Fixes dynamic symbols in an executable, speeds up application load time. Uses the new imagehlp system DLL.
Balanced binary search trees with additional efficient array-access features thrown in, a la Knuth's The Art of Programming: Fundamental Algorithms.