Python asyncio bindings for DuckDB
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aioduck-2025.9.15.tar.gz.
File metadata
- Download URL: aioduck-2025.9.15.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26cb777397effff1724b584f5b60e5cd24070d0f82ed53c59da7458f4425c346
|
|
| MD5 |
6bef8647fcbb8a77dc974d81a4671d93
|
|
| BLAKE2b-256 |
09f11c8076f41065226b713fa707ccfb4e648e48c8919760198b9dba38493250
|
Provenance
The following attestation bundles were made for aioduck-2025.9.15.tar.gz:
Publisher:
publish.yml on cnfairydream/aioduck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioduck-2025.9.15.tar.gz -
Subject digest:
26cb777397effff1724b584f5b60e5cd24070d0f82ed53c59da7458f4425c346 - Sigstore transparency entry: 522748660
- Sigstore integration time:
-
Permalink:
cnfairydream/aioduck@47cdaa4c61c190a3ffe2e8ce80c1198f939220ee -
Branch / Tag:
refs/tags/2025.9.15 - Owner: https://github.com/cnfairydream
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@47cdaa4c61c190a3ffe2e8ce80c1198f939220ee -
Trigger Event:
release
-
Statement type:
File details
Details for the file aioduck-2025.9.15-py3-none-any.whl.
File metadata
- Download URL: aioduck-2025.9.15-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73ef7fb3d32c313a2a7442cdf7f40aedf6503cdb80ba4ef6c95b5de7f0034a58
|
|
| MD5 |
ad4ba7f67917c50abac0fe7e42bc5d26
|
|
| BLAKE2b-256 |
b09121d1654963cbb2ef9451310ab7f91f0ebcadffcce6ec72f0dfd02ba198b9
|
Provenance
The following attestation bundles were made for aioduck-2025.9.15-py3-none-any.whl:
Publisher:
publish.yml on cnfairydream/aioduck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioduck-2025.9.15-py3-none-any.whl -
Subject digest:
73ef7fb3d32c313a2a7442cdf7f40aedf6503cdb80ba4ef6c95b5de7f0034a58 - Sigstore transparency entry: 522748666
- Sigstore integration time:
-
Permalink:
cnfairydream/aioduck@47cdaa4c61c190a3ffe2e8ce80c1198f939220ee -
Branch / Tag:
refs/tags/2025.9.15 - Owner: https://github.com/cnfairydream
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@47cdaa4c61c190a3ffe2e8ce80c1198f939220ee -
Trigger Event:
release
-
Statement type: