[Soc2006] Pure Python SQL API

Ian Bicking ianb at colorstudy.com
Thu May 4 18:47:23 CEST 2006


Jorge Vargas wrote:
> Hello everyone,
> 
> First of all sorry for the delay but this idea jsut came to me yesterday.
> 
> It's not 100% but i'm running short on time, if you people like it i'll 
> write a formal proposal asap.
> 
> Right now we have a really nice PEP 249 which tells mostly anything a 
> python db-interface should have.
> Now the problem comes went most drivers are half C half python, and they 
> need to be compile (my
> current nightmare is mysqldb, which under windows requires many gigs of 
> microsoft toolkits and/or buying their development env)
> 
> So what I'm proposing is something like the what is done in java where 
> they have a library and pure java connectors.
> In our case my project will revolve around the pure python core api and 
> it will be extensible with pure-python modules for each db,
> from which I'll probably write at least one as a example/test/proof of 
> concept.
> 
> does this sounds crazy? or is it really a good idea?

I think it has some potential, but I don't know if there's anyone 
suitable to mentor at the moment, and I think a mentor who understands 
the problems would be very useful to the project.  There are some 
pure-Python db connectors out there; I've seen at least two Postgres ones

* http://barryp.org/software/bpgsql
* http://www.tnr.cc/pypg.html

I saw a reference to pymysql on SF, but the project is now gone.  I 
don't think there's much reason for a framework for building these; 
DB-API is simple enough that most of the work will be in the individual 
drivers.  If a framework emerges in the process, so much the better, but 
it shouldn't be a target.

There might also be some interest from people wanting to do async 
database connections, because even if you create a blocking API (DB-API 
is blocking) it would be far far easier to adapt or extend a pure-Python 
driver to be async.

Also, libraries written in C -- database libraries in particular -- can 
be a common source of instability in long-running Python processes.

All that said, I think this project would be a bit of a stretch to get 
accepted.


-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Soc2006 mailing list