# MagicStack/asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.

Repository: https://github.com/MagicStack/asyncpg
Canonical: https://ross.abutalabs.com/products/asyncpg
Language: Python
License: Apache-2.0
License Family: permissive
Topics: postgresql, python, python-3, asyncio, async-python, async-programming, high-performance, database-driver
Last push: 2026-02-27T20:48:41+00:00

## Health v2 (maintenance only)
Score: 60/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 69, release rhythm 26, longevity 100
- inputs: {"age_days": 3698, "days_push": 187, "days_rel": 282, "gap_med": 400, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8075, forks 464 (observed 2026-08-28T04:10:12.535276+00:00)

## What it is
asyncpg is a fast PostgreSQL client library for Python built directly on the PostgreSQL binary protocol and designed for asyncio. It exposes native PostgreSQL features like prepared statements, scrollable cursors, and automatic composite/array type encoding without a DB-API facade.

## Use cases
- connect to postgresql from python asyncio code
- run high-performance queries against postgres
- execute prepared statements with async python
- fetch large query results efficiently with cursors
- work with postgres arrays and composite types in python
- build async web backends backed by postgres

## When to choose
- you use asyncio and need the fastest postgres driver for python
- you want native postgres protocol features like custom types and scrollable cursors
- you are building async applications or services on postgres

## When to avoid
- you need a synchronous driver or DB-API 2.0 compatibility
- you need multi-database support beyond postgresql
- you rely on ORMs that only support psycopg-style drivers

## Facets
- artifact type: library
- maturity: stable
- function: database-driver, database
- domain: databases, backend, developer-tools
- platform: python, cross-platform
- tags: postgresql, asyncio, binary-protocol, prepared-statements, high-performance

## Member repositories
- MagicStack/asyncpg (main) score 60

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:12.535276+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:31:20.653682+00:00, confidence not recorded.
  - readme: https://github.com/MagicStack/asyncpg (fetched 2026-08-28T04:10:12.535276+00:00, sha 491efc970950)
- Data as of 2026-08-30T08:39:29.467469+00:00.
