Where to find the 'dbi' and 'odbc' modules?

Alex Martelli aleaxit at yahoo.com
Tue Jan 16 06:45:04 EST 2001


<egmanoj at yahoo.com> wrote in message
news:mailman.979634964.31590.python-list at python.org...
> Hi all,
> I am a python newbie. I recently downloaded Python(2) for WinNT at my
> office and was fiddling with database access. Although the Python
> documentation mentions the dbi and odbc modules, they are not
> available with the Python 2 distribution. Can anyone tell me where
> these are available for download?

Python's "DB API", equivalent to Perl's "DBI", is, just like that
one, a _specification_, not 'a module': it specifies the interface
that must be supplied by any module that does offer access to a DB,
so client-code can be reasonably independent of the specific module
it uses.

mxODBC is a module, that implements ODBC for Python and (more or
less) meets the DB API specs.  www.lemburg.com/python/mxODBC.html.


A side note...

My favourite way of accessing DB's on NT (fastest, convenient) is
via Microsoft's ADO/AODX object model; you can use it (just like you
can use any other COM/Automation object model) via module win32com,
which is a part of 'win32all', the Windows extensions of Python.
(You already have them if you downloaded the ActiveState Python
distribution; if you got the standard Python distribution, you can
download win32all separately from ActiveState and install it -- it's
really, REALLY useful on Windows for all sorts of things).

However, ADO/ADOX don't meet the Python DB API specs (seems MS did
not know about them, can that be?-), so you'd need to wrap them up
in a DB-API compliant wrapper to keep your client-code portable.


Alex






More information about the Python-list mailing list