Database & Storage

Listed by section, in editorial order. Click a column header to re-sort the whole list.

Press / to search. Tags open their category. Click a row for details.

Search and filter

Results

Row number Tags

ORM 8 projects

SQLAlchemy maps classes to tables in apps outside Django, which has its own ORM. Write Python instead of raw SQL, and a Python ORM returns rows as objects.

The Python SQL Toolkit and Object Relational Mapper.
Also see: awesome-sqlalchemy
sqlalchemy/github.com/sqlalchemy/sqlalchemy /12,272 stars /
(part of Django) The Django ORM.
django/github.com/django/django /91,444 stars /
A small, expressive ORM.
coleifer/github.com/coleifer/peewee /12,002 stars /
SQLModel is based on Python type annotations, and powered by Pydantic and SQLAlchemy.
fastapi/github.com/fastapi/sqlmodel /18,504 stars /
A Pythonic interface for Amazon DynamoDB.
pynamodb/github.com/pynamodb/PynamoDB /2,646 stars /
A Python object-document mapper for working with MongoDB.
An asynchronous Python object-document mapper (ODM) for MongoDB.
BeanieODM/github.com/BeanieODM/beanie /2,708 stars /
Official MongoDB database backend for Django.

Database Drivers 16 projects

Each database calls for a Python database driver built for it. Reach PostgreSQL through Psycopg, and MySQL through mysqlclient. sqlite3 comes with Python.

A pure-Python MySQL and MariaDB client library, based on PEP 249.
PyMySQL/github.com/PyMySQL/PyMySQL /7,856 stars /
MySQL and MariaDB connector (MySQLdb1 fork).
PyMySQL/github.com/PyMySQL/mysqlclient /2,539 stars /
A PostgreSQL adapter for Python, the successor to psycopg2.
psycopg/github.com/psycopg/psycopg /2,516 stars /
A fast PostgreSQL database client library for Python/asyncio.
MagicStack/github.com/MagicStack/asyncpg /8,117 stars /
pgvector support for Python, adding vector types and similarity search to psycopg, asyncpg, SQLAlchemy, and Django.
(Python standard library) SQLite interface compliant with DB-API 2.0.
Another Python SQLite Wrapper, exposing the complete SQLite C API.
rogerbinns/github.com/rogerbinns/apsw /954 stars /
Python CLI utility and library for manipulating SQLite databases.
simonw/github.com/simonw/sqlite-utils /2,180 stars /
The official ClickHouse client, with SQLAlchemy and Superset connectors.
Python driver with native interface for ClickHouse.
An ODBC bridge for connecting to SQL Server and any other ODBC-accessible database.
mkleehammer/github.com/mkleehammer/pyodbc /3,091 stars /
The official Python driver for Oracle Database, successor to cx_Oracle.
oracle/github.com/oracle/python-oracledb /456 stars /
Official Microsoft driver for SQL Server and Azure SQL, built on ODBC for high performance.
The Python client for Redis.
redis/github.com/redis/redis-py /13,653 stars /
The official Python client for MongoDB.
The Python driver for Apache Cassandra.

Database 6 projects

Inside your process, a Python database library runs without a server. DuckDB handles analytical SQL there; to search vectors, start with Chroma.

An in-process SQL OLAP database management system, optimized for analytics and fast queries, similar to SQLite but for analytical workloads.
duckdb/github.com/duckdb/duckdb /42,674 stars /
In-process OLAP SQL engine with the full ClickHouse dialect, zero-copy pandas/Arrow interop, and federation to remote ClickHouse clusters via remoteSecure().
chdb-io/github.com/chdb-io/chdb /2,921 stars /
A developer-friendly embedded retrieval database for multimodal AI.
lancedb/github.com/lancedb/lancedb /11,811 stars /
An open-source embedding database for building AI applications with semantic search.
chroma-core/github.com/chroma-core/chroma /29,604 stars /
A lightweight, in-process vector database that embeds directly into applications.
alibaba/github.com/alibaba/zvec /16,161 stars /
A tiny, document-oriented database.
msiemens/github.com/msiemens/tinydb /7,576 stars /

Caching 6 projects

Expensive function calls get cached in memory by one cachetools decorator. DiskCache stores cached data on local disk, with no server to run.

Extensible memoizing collections and decorators.
tkem/github.com/tkem/cachetools /2,789 stars /
SQLite and file-backed cache backend, compatible with Django.
A caching API for Redis, Memcached, and others, with coordinated value regeneration.
RFC 9111-compliant HTTP caching for clients like httpx and requests and servers like FastAPI, with sync and async support.
Full-featured Redis cache backend for Django.
jazzband/github.com/jazzband/django-redis /3,086 stars /
A slick ORM cache with automatic granular event-driven invalidation.
Suor/github.com/Suor/django-cacheops /2,271 stars /

For document search, pick an engine and its official Python search library. Faiss searches vectors directly in your process.

The official low-level Python client for OpenSearch.
The official low-level Python client for Elasticsearch.
elastic/github.com/elastic/elasticsearch-py /4,394 stars /
The official Python client for the Meilisearch search engine.
Modular search for Django.
A library for efficient similarity search and clustering of dense vectors.

Serialization 6 projects

When your Python serialization library should validate too, msgspec decodes JSON straight into typed objects. Without a schema, orjson is fast and correct.

MessagePack serializer implementation for Python.
msgpack/github.com/msgpack/msgpack-python /2,108 stars /
Fast, correct JSON library.
ijl/github.com/ijl/orjson /8,281 stars /
A lightweight library for converting complex objects to and from simple Python datatypes.
A fast serialization and validation library supporting JSON, MessagePack, YAML, and TOML.
msgspec/github.com/msgspec/msgspec /4,190 stars /
Extends pickle to functions, lambdas, and interactively defined classes, for shipping code to remote workers.
cloudpipe/github.com/cloudpipe/cloudpickle /1,950 stars /
Extends pickle to serialize almost any object, including closures and interpreter sessions.
uqfoundation/github.com/uqfoundation/dill /2,449 stars /

Know a project that belongs here?

Tell us what it does and why it stands out.