duckdb 1.4.1


pip install duckdb

  Latest version

Released: Oct 07, 2025


Meta
Author: DuckDB Foundation
Maintainer: DuckDB Foundation
Requires Python: >=3.9.0

Classifiers

Development Status
  • 3 - Alpha

License
  • OSI Approved :: MIT License

Operating System
  • OS Independent

Topic
  • Database
  • Database :: Database Engines/Servers
  • Scientific/Engineering

Intended Audience
  • Developers
  • Education
  • Information Technology
  • Science/Research

Programming Language
  • Python
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • C++
DuckDB logo

Discord PyPI Latest Release


DuckDB.org | User Guide (Python) - API Docs (Python)

DuckDB: A Fast, In-Process, Portable, Open Source, Analytical Database System

  • Simple: DuckDB is easy to install and deploy. It has zero external dependencies and runs in-process in its host application or as a single binary.
  • Portable: DuckDB runs on Linux, macOS, Windows, Android, iOS and all popular hardware architectures. It has idiomatic client APIs for major programming languages.
  • Feature-rich: DuckDB offers a rich SQL dialect. It can read and write file formats such as CSV, Parquet, and JSON, to and from the local file system and remote endpoints such as S3 buckets.
  • Fast: DuckDB runs analytical queries at blazing speed thanks to its columnar engine, which supports parallel execution and can process larger-than-memory workloads.
  • Extensible: DuckDB is extensible by third-party features such as new data types, functions, file formats and new SQL syntax. User contributions are available as community extensions.
  • Free: DuckDB and its core extensions are open-source under the permissive MIT License. The intellectual property of the project is held by the DuckDB Foundation.

Installation

Install the latest release of DuckDB directly from PyPI:

pip install duckdb

Install with all optional dependencies:

pip install 'duckdb[all]'

Development

Start by forking duckdb-python.

Cloning

After forking the duckdb-python repo we recommend you clone your fork as follows:

git clone --recurse-submodules $REPO_URL
git remote add upstream https://github.com/duckdb/duckdb-python.git
git fetch --all

... or, if you have already cloned your fork:

git submodule update --init --recursive
git remote add upstream https://github.com/duckdb/duckdb-python.git
git fetch --all

Submodule update hook

If you'll be switching between branches that are have the submodule set to different refs, then make your life easier and add the git hooks in the .githooks directory to your git hooks:

cp .githooks/post-checkout .git/hooks/

Editable installs (general)

It's good to be aware of the following when performing an editable install:

  • uv sync or uv run [tool] perform an editable install by default. We have configured the project so that scikit-build-core will use a persistent build-dir, but since the build itself happens in an isolated, ephemeral environment, cmake's paths will point to non-existing directories. CMake itself will be missing.
  • You should install all development dependencies, and then build the project without build isolation, in two separate steps. After this you can happily keep building and running, as long as you don't forget to pass in the --no-build-isolation flag.
# install all dev dependencies without building the project (needed once)
uv sync -p 3.11 --no-install-project
# build and install without build isolation
uv sync --no-build-isolation

Editable installs (IDEs)

If you're using an IDE then life is a little simpler. You install build dependencies and the project in the two steps outlined above, and from that point on you can rely on e.g. CLion's cmake capabilities to do incremental compilation and editable rebuilds. This will skip scikit-build-core's build backend and all of uv's dependency management, so for "real" builds you better revert to the CLI. However, this should work fine for coding and debugging.

Cleaning

uv cache clean
rm -rf build .venv uv.lock

Building wheels and sdists

To build a wheel and sdist for your system and the default Python version:

uv build

To build a wheel for a different Python version:

# E.g. for Python 3.9
uv build -p 3.9

Running tests

Run all pytests:

uv run --no-build-isolation pytest ./tests --verbose

Exclude the test/slow directory:

uv run --no-build-isolation pytest ./tests --verbose --ignore=./tests/slow

Test coverage

Run with coverage (during development you probably want to specify which tests to run):

COVERAGE=1 uv run --no-build-isolation coverage run -m pytest ./tests --verbose

The COVERAGE env var will compile the extension with --coverage, allowing us to collect coverage stats of C++ code as well as Python code.

Check coverage for Python code:

uvx coverage html -d htmlcov-python
uvx coverage report --format=markdown

Check coverage for C++ code (note: this will clutter your project dir with html files, consider saving them in some other place):

uvx gcovr \
  --gcov-ignore-errors all \
  --root "$PWD" \
  --filter "${PWD}/src/duckdb_py" \
  --exclude '.*/\.cache/.*' \
  --gcov-exclude '.*/\.cache/.*' \
  --gcov-exclude '.*/external/.*' \
  --gcov-exclude '.*/site-packages/.*' \
  --exclude-unreachable-branches \
  --exclude-throw-branches \
  --html --html-details -o coverage-cpp.html \
  build/coverage/src/duckdb_py \
  --print-summary

Typechecking and linting

  • We're not running any mypy typechecking tests at the moment
  • We're not running any Ruff / linting / formatting at the moment

Cibuildwheel

You can run cibuildwheel locally for Linux. E.g. limited to Python 3.9:

CIBW_BUILD='cp39-*' uvx cibuildwheel --platform linux .

Code conventions

Tooling

This codebase is developed with the following tools:

  • Astral uv - for dependency management across all platforms we provide wheels for, and for Python environment management. It will be hard to work on this codebase without having UV installed.
  • Scikit-build-core - the build backend for building the extension. On the background, scikit-build-core uses cmake and ninja for compilation.
  • pybind11 - a bridge between C++ and Python.
  • CMake - the build system for both DuckDB itself and the DuckDB Python module.
  • Cibuildwheel

Merging changes to pythonpkg from duckdb main

  1. Checkout main 2Identify the merge commits that brought in tags to main:
git log --graph --oneline --decorate main --simplify-by-decoration
  1. Get the log of commits
git log --oneline 71c5c07cdd..c9254ecff2 -- tools/pythonpkg/
  1. Checkout v1.3-ossivalis
  2. Get the log of commits
git log --oneline v1.3.0..v1.3.1 -- tools/pythonpkg/

git diff --name-status 71c5c07cdd c9254ecff2 -- tools/pythonpkg/

git log --oneline 71c5c07cdd..c9254ecff2 -- tools/pythonpkg/
git diff --name-status <HASH_A> <HASH_B> -- tools/pythonpkg/

Versioning and Releases

The DuckDB Python package versioning and release scheme follows that of DuckDB itself. This means that a X.Y.Z[. postN] release of the Python package ships the DuckDB stable release X.Y.Z. The optional .postN releases ship the same stable release of DuckDB as their predecessors plus Python package-specific fixes and / or features.

Types DuckDB Version Resulting Python Extension Version
Stable release: DuckDB stable release 1.3.1 1.3.1
Stable post release: DuckDB stable release + Python fixes and features 1.3.1 1.3.1.postX
Nightly micro: DuckDB next micro nightly + Python next micro nightly 1.3.2.devM 1.3.2.devN
Nightly minor: DuckDB next minor nightly + Python next minor nightly 1.4.0.devM 1.4.0.devN

Note that we do not ship nightly post releases (e.g. we don't ship 1.3.1.post2.dev3).

Branch and Tag Strategy

We cut releases as follows:

Type Tag How
Stable minor release vX.Y.0 Adding a tag on main
Stable micro release vX.Y.Z Adding a tag on a minor release branch (e.g. v1.3-ossivalis)
Stable post release vX.Y.Z-postN Adding a tag on a post release branch (e.g. v1.3.1-post)
Nightly micro not tagged Combining HEAD of the micro release branches of DuckDB and the Python package
Nightly minor not tagged Combining HEAD of the minor release branches of DuckDB and the Python package

Release Runbooks

We cut a new stable minor release with the following steps:

  1. Create a PR on main to pin the DuckDB submodule to the tag of its current release.
  2. Iff all tests pass in CI, merge the PR.
  3. Manually start the release workflow with the hash of this commit, and the tag name.
  4. Iff all goes well, create a new PR to let the submodule track DuckDB main.

We cut a new stable micro release with the following steps:

  1. Create a PR on the minor release branch to pin the DuckDB submodule to the tag of its current release.
  2. Iff all tests pass in CI, merge the PR.
  3. Manually start the release workflow with the hash of this commit, and the tag name.
  4. Iff all goes well, create a new PR to let the submodule track DuckDB's minor release branch.

We cut a new stable post release with the following steps:

  1. Create a PR on the post release branch to pin the DuckDB submodule to the tag of its current release.
  2. Iff all tests pass in CI, merge the PR.
  3. Manually start the release workflow with the hash of this commit, and the tag name.
  4. Iff all goes well, create a new PR to let the submodule track DuckDB's minor release branch.

Dynamic Versioning Integration

The package uses setuptools_scm with scikit-build for automatic version determination, and implements a custom versioning scheme.

  • pyproject.toml configuration:

    [tool.scikit-build]
    metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
    
    [tool.setuptools_scm]
    version_scheme = "duckdb_packaging._setuptools_scm_version:version_scheme"
    
  • Environment variables:

    • MAIN_BRANCH_VERSIONING=0: Use release branch versioning (patch increments)
    • MAIN_BRANCH_VERSIONING=1: Use main branch versioning (minor increments)
    • OVERRIDE_GIT_DESCRIBE: Override version detection
1.5.0.dev56 Oct 09, 2025
1.5.0.dev53 Oct 08, 2025
1.5.0.dev44 Sep 28, 2025
1.5.0.dev37 Sep 19, 2025
1.5.0.dev32 Sep 18, 2025
1.4.2.dev27 Oct 17, 2025
1.4.2.dev26 Oct 16, 2025
1.4.2.dev23 Oct 11, 2025
1.4.2.dev6 Oct 09, 2025
1.4.2.dev1 Oct 08, 2025
1.4.1 Oct 07, 2025
1.4.1.dev141 Oct 05, 2025
1.4.1.dev137 Oct 03, 2025
1.4.1.dev135 Oct 02, 2025
1.4.1.dev125 Sep 26, 2025
1.4.1.dev116 Sep 25, 2025
1.4.1.dev113 Sep 23, 2025
1.4.1.dev12 Sep 19, 2025
1.4.1.dev6 Sep 18, 2025
1.4.0 Sep 16, 2025
1.3.2 Jul 08, 2025
1.3.1 Jun 16, 2025
1.3.0 May 21, 2025
1.2.2 Apr 08, 2025
1.2.1 Mar 05, 2025
1.2.0 Feb 05, 2025
1.1.3 Nov 04, 2024
1.1.2 Oct 14, 2024
1.1.1 Sep 24, 2024
1.1.0 Sep 09, 2024
1.0.0 Jun 03, 2024
0.10.3 May 22, 2024
0.10.2 Apr 17, 2024
0.10.1 Mar 18, 2024
0.10.0 Feb 13, 2024
0.9.2 Nov 14, 2023
0.9.1 Oct 11, 2023
0.9.0 Sep 26, 2023
0.8.1 Jun 13, 2023
0.8.0 May 17, 2023
0.7.1 Feb 27, 2023
0.7.0 Feb 13, 2023
0.6.1 Dec 06, 2022
0.6.0 Nov 14, 2022
0.5.1 Sep 19, 2022
0.5.0 Sep 05, 2022
0.4.0 Jun 20, 2022
0.3.4 Apr 25, 2022
0.3.3 Apr 11, 2022
0.3.2 Feb 07, 2022
0.3.1 Nov 16, 2021
0.3.0 Oct 06, 2021
0.2.9 Sep 06, 2021
0.2.8 Aug 02, 2021
0.2.7 Jun 14, 2021
0.2.6 May 08, 2021
0.2.5 Mar 10, 2021
0.2.4 Feb 02, 2021
0.2.3 Dec 03, 2020
0.2.2 Nov 01, 2020
0.2.1 Aug 29, 2020
0.2.0 Jul 23, 2020
0.1.9 Jun 19, 2020
0.1.8 Jun 05, 2020
0.1.7 May 04, 2020
0.1.6 Apr 08, 2020
0.1.5 Mar 03, 2020
0.1.3 Feb 03, 2020
0.1.2 Jan 06, 2020
0.1.1 Sep 24, 2019
0.1.0 Jun 27, 2019
0.0.3 May 08, 2019
0.0.2 May 08, 2019
0.0.0 Dec 16, 2023

Wheel compatibility matrix

Platform CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13
macosx_10_13_universal2
macosx_10_13_x86_64
macosx_10_9_universal2
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux_2_27_aarch64
manylinux_2_27_x86_64
manylinux_2_28_aarch64
manylinux_2_28_x86_64
win_amd64

Files in release

duckdb-1.4.1-cp310-cp310-macosx_10_9_universal2.whl (27.7MiB)
duckdb-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl (15.4MiB)
duckdb-1.4.1-cp310-cp310-macosx_11_0_arm64.whl (13.1MiB)
duckdb-1.4.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (17.6MiB)
duckdb-1.4.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (19.5MiB)
duckdb-1.4.1-cp310-cp310-win_amd64.whl (11.8MiB)
duckdb-1.4.1-cp311-cp311-macosx_10_9_universal2.whl (27.7MiB)
duckdb-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl (15.4MiB)
duckdb-1.4.1-cp311-cp311-macosx_11_0_arm64.whl (13.1MiB)
duckdb-1.4.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (17.6MiB)
duckdb-1.4.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (19.5MiB)
duckdb-1.4.1-cp311-cp311-win_amd64.whl (11.8MiB)
duckdb-1.4.1-cp312-cp312-macosx_10_13_universal2.whl (27.7MiB)
duckdb-1.4.1-cp312-cp312-macosx_10_13_x86_64.whl (15.4MiB)
duckdb-1.4.1-cp312-cp312-macosx_11_0_arm64.whl (13.1MiB)
duckdb-1.4.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (17.6MiB)
duckdb-1.4.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (19.6MiB)
duckdb-1.4.1-cp312-cp312-win_amd64.whl (11.8MiB)
duckdb-1.4.1-cp313-cp313-macosx_10_13_universal2.whl (27.7MiB)
duckdb-1.4.1-cp313-cp313-macosx_10_13_x86_64.whl (15.4MiB)
duckdb-1.4.1-cp313-cp313-macosx_11_0_arm64.whl (13.1MiB)
duckdb-1.4.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (17.6MiB)
duckdb-1.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (19.6MiB)
duckdb-1.4.1-cp313-cp313-win_amd64.whl (11.8MiB)
duckdb-1.4.1-cp39-cp39-macosx_10_9_universal2.whl (27.7MiB)
duckdb-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl (15.4MiB)
duckdb-1.4.1-cp39-cp39-macosx_11_0_arm64.whl (13.1MiB)
duckdb-1.4.1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (17.6MiB)
duckdb-1.4.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (19.5MiB)
duckdb-1.4.1-cp39-cp39-win_amd64.whl (11.8MiB)
duckdb-1.4.1.tar.gz (17.6MiB)
Extras:
Dependencies: