Database Drivers in Python

16 projects in Database & Storage. Most starred: redis, asyncpg and pymysql.

For PostgreSQL, psycopg (version 3, the successor to psycopg2) supports both sync and async code and is what most frameworks use by default. asyncpg is async-only and implements the PostgreSQL binary protocol directly, which makes it fast for asyncio services. pgvector adds vector types and similarity operators to these drivers and to SQLAlchemy. For MySQL and MariaDB, mysqlclient is a C extension that needs the client libraries installed, and PyMySQL is pure Python, slower but easy to install anywhere.

SQLite ships with Python as the sqlite3 module. APSW exposes the complete SQLite API for when you need features sqlite3 does not wrap, and sqlite-utils is a CLI and library for creating and transforming SQLite databases. ClickHouse has the official clickhouse-connect, which uses the HTTP interface, and clickhouse-driver, which speaks the native protocol. For enterprise databases, oracledb runs without Oracle Client libraries in its default thin mode, mssql-python is Microsoft's official SQL Server driver, and pyodbc reaches any ODBC source. redis-py, PyMongo and the Cassandra driver cover the main NoSQL stores.

Deeper lists: awesome-mysqlawesome-postgresawesome-sqlite

MySQL2

pymysql

A pure-Python MySQL and MariaDB client library, based on PEP 249.

7.9kupdated 3d ago1.2.3

mysqlclient

MySQL and MariaDB connector (MySQLdb1 fork).

2.5kupdated 6d ago2.3.0

PostgreSQL3

psycopg

A PostgreSQL adapter for Python, the successor to psycopg2.

2.5kupdated 12d ago

asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.

8.1kupdated 15d ago0.32.0

pgvector

Pgvector support for Python, adding vector types and similarity search to psycopg, asyncpg, SQLAlchemy, and Django.

1.5kupdated 3d ago

SQLite3

sqlite3Standard library

SQLite interface compliant with DB-API 2.0.

apswC core

Another Python SQLite Wrapper, exposing the complete SQLite C API.

950updated today3.54.1.0

sqlite-utils

Python CLI utility and library for manipulating SQLite databases.

2.2kupdated 13d ago4.2.1

ClickHouse2

clickhouse-connect

The official ClickHouse client, with SQLAlchemy and Superset connectors.

532updated 2d ago1.11.0

clickhouse-driver

Python driver with native interface for ClickHouse.

1.3kupdated 3mo ago0.2.11

Other Relational Databases3

pyodbcC++ core

An ODBC bridge for connecting to SQL Server and any other ODBC-accessible database.

3.1kupdated today5.3.0

oracledb

The official Python driver for Oracle Database, successor to cx_Oracle.

455updated today26.0.1

mssql-python

Official Microsoft driver for SQL Server and Azure SQL, built on ODBC for high performance.

481updated 2d ago1.16.0

NoSQL Databases3

redis

The Python client for Redis.

13.7kupdated 1d ago8.1.0

pymongo

The official Python client for MongoDB.

4.4kupdated today4.19.0

cassandra-driver

The Python Driver for Apache Cassandra.

1.4kupdated 3mo ago
Esc

Type to search every entry. ↑↓ to move, Enter to open.