Skip to main content

Python asyncio bindings for DuckDB

aioduck provides a friendly, async interface to DuckDB databases.

Usage

It replicates the standard duckdb module, but with async versions of all the standard connection and cursor methods, plus context managers for automatically closing connections and cursors:

from aioduck import AsyncConnection

async with AsyncConnection(...) as conn:
    await conn.execute("INSERT INTO some_table ...")
    await conn.commit()

    async with conn.cursor() as cursor:
        await cursor.execute("SELECT * FROM some_table")
        async for row in cursor:
            ...

It can also be used in the traditional, procedural manner:

from aioduck import AsyncConnection

db = await AsyncConnection(...)
cursor = db.cursor()
await db.execute('SELECT * FROM some_table')
row = await cursor.fetchone()
rows = await cursor.fetchall()
await cursor.close()
await db.close()

Install

aioduck is compatible with Python 3.11 and newer. You can install it from PyPI:

$ pip install aioduck

Details

aioduck allows interaction with DuckDB databases on the main AsyncIO event loop without blocking execution of other coroutines while waiting for queries or data fetches. It does this by using an agent. This agent executes all actions within a shared request queue to prevent overlapping actions.

Connection objects are proxies to the real connections through the agent. Cursors are similarly proxies to the real cursors, and provide async iterators to query results.

License

aioduck is licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

Release files for aioduck 2025.9.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioduck 2025.9.15
File Size Uploaded
aioduck-2025.9.15.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aioduck 2025.9.15
File Interpreter ABI Platform
aioduck-2025.9.15-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / aioduck-2025.9.15.tar.gz

Download URL aioduck-2025.9.15.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
26cb777397effff1724b584f5b60e5cd24070d0f82ed53c59da7458f4425c346
BLAKE2b-256 checksum
How to use checksums
09f11c8076f41065226b713fa707ccfb4e648e48c8919760198b9dba38493250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2025.

Transparency log

Release files / aioduck-2025.9.15-py3-none-any.whl

Download URL aioduck-2025.9.15-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73ef7fb3d32c313a2a7442cdf7f40aedf6503cdb80ba4ef6c95b5de7f0034a58
BLAKE2b-256 checksum
How to use checksums
b09121d1654963cbb2ef9451310ab7f91f0ebcadffcce6ec72f0dfd02ba198b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2025.9.15 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page