Accessing Relational Databases with Python

By:
To add a paper, Login.

This presentation will introduce the means and patterns of accessing databases from Python. It will start with a brief overview of the Python Database API (2.0) with some interactive examples. A quick overview of which databases are supported will follow with a brief diversion to non-relational data stores. Then I will talk about some of the issues that the DB API doesn't solve and which commonly surprise people new to either databases or Python. In particular I'll concentrate on the proper use of bind variables and how to make your SQL as database neutral as possible. I'll contrast the Python DB API approach with that of Java (JDBC) and Perl (DBI).

This then will lead to a discussion of Python database 'helper' modules like dtuple.py, db_row and PyTable. Finally I'll talk about the available Object Relational Mappers, introducing them based on the pattern they implement. If there's enough time left I'll attempt to demonstrate one or two of the more popular ORM tools and examine their strengths and weaknesses.


Keywords: python, database, rdbms
Stream: Python
Presentation Type: 30 minute Paper Presentation in English
Paper: Using Relational Databases with Python


Andy Todd

Halfcooked Solutions
Sydney, NSW, AUSTRALIA

A database professional by trade, Andrew has been learning Python since 2000, when he learnt it whilst watching the Olympic sailing from the office window. Python has been providing database support since its early releases with a formal API in place for over ten years. Andrew is the current co-ordinator of the Python database special interest group (SIG) and has been using Python to access relational databases since he started to learn the language.

Ref: OS6P0025