finds.dev← search

// the find

coleifer/peewee

★ 11,970 · Python · MIT · updated Jun 2026

a small, expressive orm -- supports postgresql, mysql, sqlite, now with asyncio

Peewee is a mature, single-file Python ORM that has been in production since 2010. It targets developers who find SQLAlchemy too heavy and Django ORM too coupled to Django — people who want SQL control without raw SQL everywhere. The asyncio support landed recently via a separate `pwasyncio` module built on asyncpg/aiosqlite/aiomysql.

The single-module design is genuinely useful: you can vendor `peewee.py` into a project and never worry about dependency hell. Query composition is a first-class citizen — queries are objects you can build, pass around, and combine before executing, which makes the `SELECT ... WHERE ... JOIN` patterns actually readable. The `playhouse/` extensions are well-considered (connection pooling, migrations, SQLCipher, dataset-style interface) rather than bolted-on afterthoughts. The asyncio implementation uses native async drivers properly (asyncpg for Postgres, aiosqlite for SQLite) instead of wrapping sync calls in thread executors.

The asyncio API feels grafted on — you need `AsyncPostgresqlDatabase` from `playhouse.pwasyncio` rather than just passing `async=True`, and existing sync models don't just become awaitable. Migrations in `playhouse/migrate.py` are manual and imperative, not auto-generated from model diffs; you'll miss Alembic the moment your schema gets complex. The ORM's expressiveness drops off at non-trivial SQL — window functions, lateral joins, and recursive CTEs require falling back to raw SQL or the lower-level query builder. Type hints exist but are incomplete, which means mypy won't catch column-type mismatches until runtime.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →