Python
From PostgreSQL wiki
Jump to navigationJump to searchThere are several Python drivers for PostgreSQL. This is the incomplete feature matrix for them; please help complete it as you see fit.
In general, Python users want to use psycopg2 unless they have a strong reason to try another driver, most of which are no longer maintained. Since DBAPI allows drivers to have different semantics, porting applications from one driver to another is non-trivial.
Software | License | Platforms | Python versions | DB API 2.0 | Native (uses libpq) | Last Release | Notes |
---|---|---|---|---|---|---|---|
Psycopg2 | LGPL | Unix, Win32 | 2.6-3.6 | yes | yes | 2019 | Most popular python driver, required for most Python+Postgres frameworks |
pg8000 | BSD | any (pure Python) | 3.3+ | yes | no | 2019 | Used by Web2Py. current updated official site |
py-postgresql | BSD | any (pure Python) | 3.0+ | yes | no | 2018 | Pure Python with optional C accelerator modules,<br\>extensive custom API. Python 3 only. |
PyGreSQL | BSD | Unix, Win32 | 2.6 thru 3.6 | yes | yes | 2017 | The first PostgreSQL adapter for Python. Still actively maintained. |
ocpgdb | BSD | Unix | 2.3-2.6 | yes | yes | 2010 | PG8.1+ |
bpgsql | LGPL | any (pure Python) | 2.3-2.6 | yes | no | 2009 | labeled alpha |
aiopg | BSD | any | 3.52+ | (ish) | Native | 2019 |
More abandoned driver projects:
- pgasync, Twisted-native driver, no updates since 2005
- PoPy, no updates since 2003 - development was merged with pygresql
- pyPgSQL, no updates since 2006
There is similar page on the Python wiki