Skip to main content

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

aioduck-2025.9.15.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioduck-2025.9.15-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

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

Hashes for aioduck-2025.9.15.tar.gz
Algorithm Hash digest
SHA256 26cb777397effff1724b584f5b60e5cd24070d0f82ed53c59da7458f4425c346
MD5 6bef8647fcbb8a77dc974d81a4671d93
BLAKE2b-256 09f11c8076f41065226b713fa707ccfb4e648e48c8919760198b9dba38493250

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioduck-2025.9.15.tar.gz:

Publisher: publish.yml on cnfairydream/aioduck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for aioduck-2025.9.15-py3-none-any.whl
Algorithm Hash digest
SHA256 73ef7fb3d32c313a2a7442cdf7f40aedf6503cdb80ba4ef6c95b5de7f0034a58
MD5 ad4ba7f67917c50abac0fe7e42bc5d26
BLAKE2b-256 b09121d1654963cbb2ef9451310ab7f91f0ebcadffcce6ec72f0dfd02ba198b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioduck-2025.9.15-py3-none-any.whl:

Publisher: publish.yml on cnfairydream/aioduck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page