Differences between revisions 32 and 95 (spanning 63 versions)
Revision 32 as of 2006-09-05 11:19:51
Size: 5734
Editor: 211
Comment: pymssql
Revision 95 as of 2008-12-07 08:55:11
Size: 3979
Editor: pool-72-83-83-34
Comment: corrected name and link to SAP MaxDB interface
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
  ''This page seems to duplicate ChoosingDatabase, wouldn't it be better to merge shelve and the rest there? -- DanielDittmar [[DateTime(2003-02-11T23:15:22)]]'' <<TableOfContents>>
Line 3: Line 3:
  ''I don't think so. Now they surely have to be refactored both, but ChoosingDatabase seems to be a good page for one place for categorized comparision to narrow novice's choice while that is merely a catalog. -- MikeRovner [[DateTime(2003-02-11T16:50:45)]]'' The contents of this page are being merged into the ChoosingDatabase page.
Line 5: Line 5:
  ''I seems missed DbApiModuleComparison page. Probably I better combine them with links from both places. -- MikeRovner [[DateTime()]]'' = Relational database =
Line 7: Line 7:
Databases based on a relational model, with support for SQL.
Line 8: Line 9:
== ODBC ==
Line 9: Line 11:
[[TableOfContents]] ODBC allows you to use a single library and API to connect to many different databases, including most of those below.
Line 11: Line 13:
See also HigherLevelDatabaseProgramming

= DBMS interfaces =
Things you connect to.

Take a look at
http://www.python.org/topics/database/modules.html and
http://dmoz.org/Computers/Programming/Languages/Python/Modules/Databases_and_Persistence/.
 * pyodbc: http://code.google.com/p/pyodbc Open source, mature DB API library
Line 21: Line 16:
 * mysqldb module http://www.mysql.com/downloads/api-python.html
 * SnakeDb (http://www.scriptfoundry.com/modules/snakedb/)
 * mysql-python: http://sourceforge.net/projects/mysql-python
Line 25: Line 19:
 * psycopg (http://www.zope.org/Members/fog/psycopg) (!) preferable
  *important notes for psycopg
   *for commands that require running outside of a transaction use autocommit
    *ie conn.autocommit()
   *never commit on a cursor, always commit on a connection
 * pyPgSQL (http://pypgsql.sf.net/)
 * ["sipPQ"]
 * PyGreSQL (http://www.pygresql.org) and PoPy (http://sourceforge.net/projects/popy) are [http://archives.postgresql.org/pgsql-announce/2003-07/msg00002.php merging]
 * PostgresPy (http://python.projects.postgresql.org/)
 * pgasync (http://jamwt.com/pgasync/)

 * psycopg
  * psycopg1: http://initd.org/projects/psycopg1
  * psycopg2: http://initd.org/projects/psycopg2

 * pyPgSQL: http://pypgsql.sourceforge.net/

 * PyGreSQL: http://www.pygresql.org/

 * PoPy: http://sourceforge.net/projects/popy
  * PoPy and PyGreSQL are [[http://www.zope.org/Members/tm/Full_Announce|merging]]

 * pg/python: http://python.projects.postgresql.org/
  * pg_proboscis: DB-API 2.0 and GreenTrunk Interfaces http://python.projects.postgresql.org/project/pg_proboscis.html
  * pg_pqueue: PQ 3.0 Protocol elements http://python.projects.postgresql.org/project/pg_pqueue.html

 * pgasync: http://jamwt.com/pgasync/
Line 36: Line 37:

 * bpgsql: http://barryp.org/software/bpgsql/
  * Barebones pure-Python PostgreSQL client

 * [[sipPQ]]

 * mxODBC: http://www.egenix.com/products/python/mxODBC/
  * Supports the [[http://www.postgresql.org/ftp/odbc/versions/|PostgreSQL ODBC driver]] on both Windows and Unix.
Note that you have to enable the advanced option "Use bytea for lo" in case you want to work with BLOBs.
Line 39: Line 49:
See ["Oracle"] for details, there are two choices:
 * dcOracle
 * cx_Oracle
 * cx_Oracle: http://www.python.net/crew/atuining/cx_Oracle/

 * DCOracle: http://www.zope.org/Products/DCOracle/
  * This is for old Oracle versions (7 and 8).

 * DCOracle2: http://www.zope.org/Members/matt/dco2
  * For Oracle 8i and up.

 * mxODBC: http://www.egenix.com/products/python/mxODBC/
  * Supports the [[http://www.oracle.com/technology/tech/oci/instantclient/index.html|Oracle Instant Client]] which is available for Windows and many popular Unix platforms.

== IBM DB2 ==

 * More info on [[DB2]]
Line 44: Line 65:
module developed by Dave Cole http://www.object-craft.com.au/projects/sybase/
Line 46: Line 66:
== MSSQL ==
* by Dave Cole: http://www.object-craft.com.au/projects/mssql/
 * pymssql: http://pymssql.sourceforge.net/
 * sybase
* old: http://www.object-craft.com.au/projects/sybase/
  * new: http://python-sybase.sourceforge.net/
Line 50: Line 70:
== BerkeleyDb ==  * mxODBC: http://www.egenix.com/products/python/mxODBC/
  * Supports Sybase ASE and Sybase Anywhere.
Line 52: Line 73:
== ThinkSQL ==
 * Pure Python DB-API 2.0 module http://www.thinksql.co.uk
== MaxDB/SAPDB ==

 * sdb: http://help.sap.com/saphelp_nw04s/helpdata/en/3c/5c02409d59ea69e10000000a155106/frameset.htm

 * mxODBC: http://www.egenix.com/products/python/mxODBC/
  * MaxDB/SAPDB's native CLI is ODBC compatible and mxODBC can link directly against the CLI libs on Unix. It also supports the ODBC driver on Windows.
Line 56: Line 81:
 * DB-API 2.0 module available here: http://informixdb.sourceforge.net/
 * InformixDB: http://informixdb.sourceforge.net/

 * mxODBC: http://www.egenix.com/products/python/mxODBC/
  * Note: The Informix ODBC drivers are included in the Informix CSDK.

== Ingres ==

 * ingresdbi: http://www.ingres.com

== Microsoft SQL Server ==

 * See [[SQL Server]]
Line 60: Line 97:
== gadfly ==
Gadfly is a simple relational database system implemented in Python based on the SQL Structured Query Language.
Currently use C-extension module for speed. Pure Python version included.
http://gadfly.sourceforge.net/
== buzhug ==
Line 65: Line 99:
== ZODB ==
http://www.zope.org/Wikis/ZODB Zope Object DB
[[http://buzhug.sourceforge.net/|buzhug]] is a pure-Python database engine, using a Pythonic, no-SQL syntax.
Line 68: Line 101:
== shelve ==
A [http://www.python.org/doc/current/lib/module-shelve.html ''shelf''] is a persistent, dictionary-like object. The difference with ''dbm'' databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the [http://www.python.org/doc/current/lib/module-pickle.html pickle] module can handle. This includes most class instances, recursive data types, and objects containing lots of shared sub-objects. The keys are ordinary strings.
The data is stored and accessed on disk (it is not an in-memory database). The implementation has been designed to make all operations, and especially selection, as fast as possible with an interpreted language.
Line 71: Line 103:
== KirbyBase ==
http://www.netpromi.com/kirbybase.html
A limited benchmark using the same use cases as SQLite's author shows that buzhug is much faster than other pure-Python modules (KirbyBase, gadfly). SQLite, which is implemented in C, is faster, but only less than 3 times on the average.
Line 74: Line 105:
== SnakeSQL ==
Line 75: Line 107:
= Datafiles interfaces =
Things you open.

== xBase ==
Which stands for .dbf files interface.[[BR]]
.dbf files were produced by several old systems like dBase(II,III,IV), Fox(Base,Pro)
 * xBase (http://linux.techass.com/projects/xdb/) - Python interface in plans
 * http://www.fiby.at/dbfpy/index.html - working now. or (take it [http://starship.python.net/crew/jjkunce/python/dbfpy.tgz here])
 * http://www.sequiter.com/products/Python/
 * http://cbbrowne.com/info/xbase.html
 * http://www.e-bachmann.dk/docs/xbase.htm - dead link

== dbm ==
A family of old unix plain hash tables. Has varieties like dbm, ndbm, gdbm, dbmdb185.[[BR]]
See [http://www.python.org/doc/current/lib/module-anydbm.html anydbm],
[http://www.python.org/doc/current/lib/module-dumbdbm.html dumbdbm],
[http://www.python.org/doc/current/lib/module-dbhash.html dbhash],
[http://www.python.org/doc/current/lib/module-bsddb.html bsddb],
[http://www.python.org/doc/current/lib/module-dbm.html dbm],
[http://www.python.org/doc/current/lib/module-gdbm.html gdbm]
in Python Standard Library.

== MetaKit ==
http://www.equi4.com/metakit/python.html

== SQLite ==
Actualy it's a full-fleged SQL server, but embeddable. No external SQL server required. Think of Gadfly, only faster.
http://pysqlite.org/

= XML Databases or Interfaces =

== Forest ==

[http://cvs.infrae.com/forest/ Forest] is a (native) XML database written in Python. It is intended to
support fast queries of XML data.


== 4ODS ==

http://www.4suite.org/


= Object-Relational Mappers =

[http://sqlobject.org SQLObject] is an object-relational mapper. It allows you to translate
RDBMS table rows into Python objects, and manipulate those objects to
transparently manipulate the database.

[http://www.tux4web.de/orm ORM] The Object Relational Membrane is a Python package that provides the functionality of an object relational layer like EJB or other persistence storage systems. It is a thin compatibility layer between SQL table layouts and Object Oriented Python. While providing a good deal of functionality, it tries to be as small and simple as possible. It works with PostgreSQL and MySQL.

[http://www.qlime.org/ QLime] Easy to use, transparent data access to relational databases or other data sources. See examples here: http://www.qlime.org/example.rst

See also HigherLevelDatabaseProgramming.

= Special file interface =

 * http://python-dsv.sourceforge.net/ CSV or any separated file (see also PEP:0305)
 * ConfigParser.py - Windows .ini format
 * gzip.py
 * zipfile.py
 * tar
 * pdf http://www.pythonware.com/
 * PyTables
[[http://www.pythonweb.org/projects/snakesql/|SnakeSQL]] is a pure Python SQL database written to remove the dependence of the Python Web Modules on 3rd party drivers for non-Python databases like MySQL but designed to be a useful database in its own right.

The contents of this page are being merged into the ChoosingDatabase page.

Relational database

Databases based on a relational model, with support for SQL.

ODBC

ODBC allows you to use a single library and API to connect to many different databases, including most of those below.

MySQL

PostgreSQL

Note that you have to enable the advanced option "Use bytea for lo" in case you want to work with BLOBs.

Oracle

IBM DB2

  • More info on DB2

Sybase

MaxDB/SAPDB

Informix

Ingres

Microsoft SQL Server

Native Python Databases

buzhug

buzhug is a pure-Python database engine, using a Pythonic, no-SQL syntax.

The data is stored and accessed on disk (it is not an in-memory database). The implementation has been designed to make all operations, and especially selection, as fast as possible with an interpreted language.

A limited benchmark using the same use cases as SQLite's author shows that buzhug is much faster than other pure-Python modules (KirbyBase, gadfly). SQLite, which is implemented in C, is faster, but only less than 3 times on the average.

SnakeSQL

SnakeSQL is a pure Python SQL database written to remove the dependence of the Python Web Modules on 3rd party drivers for non-Python databases like MySQL but designed to be a useful database in its own right.

DatabaseInterfaces (last edited 2020-12-09 09:29:13 by MarcAndreLemburg)

Unable to edit the page? See the FrontPage for instructions.