Python as replacement for PHP?

David M. Cooke cookedm+news at physics.mcmaster.ca
Thu Mar 4 20:57:02 CET 2004


At some point, Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:
> paul at boddie.net (Paul Boddie) writes:
>> Really? At the fundamental level, the DB-API is pretty well
>> standardised, and there's a collection of well-written modules that
>> mostly adhere to it.
>
> Nope.  Look in the Python distribution, there's nothing like that
> there, and similarly in the Python reference manual.  Yeah, there's
> some random third party modules and docs, but see above, those don't
> exist ;-).

http://python.org/peps/pep-0249.html

PEP 249 is the DB-API. Ok, so it's not in the standard distribution --
as you said, there aren't any (SQL) database modules in the standard
distribution [1]. But this is the standard API for database interfacing
(and it's not a third-party API, either). Most third-party modules
conform to it (except for weird or old ones).

[1] maybe gadfly will get added at some point, though.

And hey, if you're choosing a database module, you've got to have
already chosen a database -- MySQL, PostgreSQL, SQLite, etc. This is a
bigger choice than "how do I talk to it." The Python DB-API makes it
relatively easy to write code where the difference in talking to
different databases is only in your SQL, and not how you call it.

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



More information about the Python-list mailing list