HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
MagicStack
asyncpg
Python2016–2024
MagicStack / asyncpg

asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.

23Distinct people
29Mentions
0Explicit recommenders
8.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A fast PostgreSQL Database Client Library for Python/asyncio.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 6:01:08 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year29 dated mentions

Observed mentions: 2016-07-19 09:54:11 UTC to 2024-08-18 21:22:19 UTC.

02462016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 6 mentions; 3 submissions, 3 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC633
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC404
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC505
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC303
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC413
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC514

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio asyncpg is a database interface library designed specifically for PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python's asyncio framework. You can read more about asyncpg in an introductory blog post. asyncpg requires Python 3.9 or later and is supported for PostgreSQL versions 9.5 to 19. Other PostgreSQL versions or other databases implementing the PostgreSQL protocol may work, but are not being actively tested. Documentation The project documentation can be found here. Performance In our testing asyncpg is, on average, 5x faster than psycopg3. The above results are a geometric mean of benchmarks obtained with PostgreSQL client driver benchmarking toolbench in June 2023 (click on the chart to see full details). Features asyncpg implements PostgreSQL server protocol natively and exposes its features directly, as opposed to hiding them behind a generic facade like DB-API. This enables asyncpg to have easy-to-use support for: prepared statements scrollable cursors partial iteration on query results automatic encoding and decoding of composite types, arrays, and any combination of those straightforward support for custom data types Installation asyncpg is available on PyPI. When not using GSSAPI/SSPI authentication it has no dependencies. Use pip to install: $ pip install asyncpg If you need GSSAPI/SSPI authentication, use: $ pip install 'asyncpg[gssauth]' For more details, please see the documentation. Basic Usage import asyncio import asyncpg async def run(): conn = await asyncpg.connect(user='user', password='password', database='database', host='127.0.0.1') values = await conn.fetch( 'SELECT * FROM mytable WHERE id = $1', 10, ) await conn.close() asyncio.run(run()) License asyncpg is developed and distributed under the Apache 2.0 license.
Read the full README on GitHub

What Hacker News says

5 sources
Does the celery SQLAlchemy broker support PostgreSQL's LISTEN/NOTIFY features? Similar support in SQLite would simplify testing applications built with celery. How to add table event messages to SQLite so that the SQLite broker has the same features as AMQP? Could a vtable facade send messages on tablet events? Are there sqlite Triggers? Celery > Backends and Brokers: https://docs.celeryq.dev/en/stable/getting-started/backends-... /? sqlalchemy listen notify: https://www.google.com/search?q=sqlalchemy+listen+notify : asyncpg.Connection.add_listener sqlalchemy.event.listen, @listen_for psychopg2 conn.poll(), while connection.notifies psychopg2 > docs > advanced > Advanced notifications: https://www.psycopg.org/docs/advanced.html#asynchronous-noti... PgQueuer.db, PgQueuer.listeners.add_listener; asyncpg add_listener: https://github.com/
Read the rest
In Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
nbrad·Jan 27, 2024Submission

Ask HN: Is Python async/await some kind of joke?

Returning to Python full-stack development after a stint with Node, it seems like using async/await is not widely adopted enough in the Python ecosystem to actually use? In no particular order - Django doesn’t have an async ORM? (https://docs.djangoproject.com/en/5.0/topics/async/) - Django Rest Framework has no async support? https://github.com/encode/django-rest-framework/issues/7260 - SQLModel’s section on async support basically says “docs coming soon”? Yet this is designed to be used with FastAPI? Why would the docs not start with async/await? https://sqlmodel.tiangolo.com/advanced/ - SqlAlchemy/asyncpg => you can’t use it if you’re using PgBouncer (necessary most of the time with Postgres) in transaction mode? What?? https://github.com/MagicStack/asyncpg/issues/1058 - Ubiquitous “requests” library used in most docs examples, no asyn
Read the rest
c support https://github.com/psf/requests - Top package for GitHub REST API, no async support https://github.com/PyGithub/PyGithub - …on and on… What’s the point of my nice FastAPI server if nothing internally can use async/await? How is everyone else doing this? /rant
8 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.