PGCon2012 - Slide release #12

PGCon 2012
The PostgreSQL Conference

Jan Urbański
Day Talks - 2 - Friday - 2012-05-18
Room MRT 212
Start time 10:00
Duration 01:00
ID 417
Event type Lecture
Track Applications
Language used for presentation English

On snakes and elephants

Using Python with and in PostgreSQL

Python is one of the most popular application programming languages and there's a plethora of PostgreSQL libraries and utilities for Python.

This talk will try to give an overview of the contemporary Python-PostgreSQL landscape in a way that's useful both for Python programmers starting on a PostgreSQL project and DBAs dealing with what those programmers wrote. We'll try cover a slightly opinionated selection of libraries, frameworks and technologies and give some recommendations.

The richeness of the environment is sometimes confusing. Python people starting with PostgreSQL often don't know which driver or ORM library should they be using. Sometimes they're not aware of all the things PostgreSQL can offer to a Python programmer and the tools available.

On the other hand, DBAs sometimes need to debug Python programs (mis)using their database and PostgreSQL-savvy people join or consult on projects written in Python and need to have at least a basic understanding of how Python works, particularily on the database connection front.

We'll try to make both of these groups a bit more comfortable when dealing with the other. The talk will cover available drivers, focusing especially on psycopg2 and some of its lesser-known features and ORM libraries, focusing mainly on SQLAlchemy. We'll also discuss PL/PythonU, the possibilities it opens, along with some best practices and caveats.