I got MySQLdb working with MySQL4, it's pretty similar to the PHP implementation, although error handling isn't great (nor is documentation!) I'm going to look at the ADOdb wrapper, which has the DB-API2 documentation to go with it, and some error handling outside of just try...except