// the find
aio-libs/aiopg
aiopg is a library for accessing a PostgreSQL database from the asyncio
aiopg wraps psycopg2 to give asyncio-native PostgreSQL access, including an optional SQLAlchemy Core integration layer. It's for Python async services that need Postgres and either don't want asyncpg or need SQLAlchemy expression language without SQLAlchemy's ORM overhead.
SQLAlchemy Core integration is a genuine differentiator — you get parameterized query building without the ORM, which is useful for complex dynamic queries. Connection pooling is built in and async-native, not bolted on. The test suite is thorough: separate test files per concern (pool, cursor, transactions, SA integration) suggest the edge cases are actually covered. LISTEN/NOTIFY support via the notify.py example means it handles Postgres pub/sub, which asyncpg also does but SQLAlchemy async doesn't make easy.
This wraps psycopg2 (the old sync driver) via a thread executor hack, not a truly async Postgres driver — asyncpg is genuinely async at the protocol level and will outperform this under load. The SQLAlchemy integration is Core-only and targets the older 1.x-style API; SQLAlchemy 2.0 ships its own async support now, which makes this layer redundant for most new projects. Activity has slowed noticeably — last meaningful change was late 2025 and the maintainer list is thin. If you're starting fresh, asyncpg + SQLAlchemy 2.0's native async is the cleaner path.