Skip to main content

duckpd

DuckPD is an experimental lazy DataFrame library with a pandas-shaped frontend and DuckDB as its execution engine.

[!WARNING] DuckPD is a work in progress and is not yet recommended for production-critical workloads. The API and supported pandas semantics may change between 0.x releases, and many pandas operations are intentionally unsupported. Validate results and resource behavior for each intended workload before adopting it.

DuckPD intentionally supports a small, explicit subset of pandas rather than silently falling back to materializing a complete pandas DataFrame. See the release policy for the pre-1.0 stability policy.

Current capabilities

  • Lazy pandas, Arrow, Parquet, DuckDB table, and read-only SQL sources.
  • Column selection, boolean filtering, arithmetic expressions, assign, sort_values, and limit.
  • Eager DataFrame and Series count, size, sum, mean, min, and max reductions over numeric and boolean data, including skipna, min_count, and DataFrame numeric_only support.
  • Explicit lazy indexes with set_index()/reset_index() and source index=/order_by= declarations.
  • Explicit pandas collection, bounded head, Arrow tables and record batches, physical plan inspection, and direct Parquet writes.
  • Session-level memory, spill-directory, temporary-size, and thread settings.
  • Rejection of ambiguous cross-frame alignment and mutating SQL.

Example

import duckpd as pd

orders = pd.read_parquet("orders/*.parquet")

result = (
    orders[orders["status"] == "paid"]
    .assign(net=lambda frame: frame["amount"] - frame["refund_amount"])
    .sort_values("net", ascending=False)[["order_id", "net"]]
    .limit(100)
)

print(result.explain())
preview = result.head(10)
result.write_parquet("largest-paid-orders.parquet")
pandas_result = result.collect()

Transformations above are lazy. explain(), head(), collect(), Arrow output, and file output are explicit execution boundaries. limit() stays lazy while head() returns a bounded pandas preview.

Demos

Small runnable programs are available in demo/:

uv run python demo/basic_pipeline.py
uv run python demo/parquet_pipeline.py
uv run python demo/reduction_pipeline.py
uv run python demo/generate_market_data.py
uv run python demo/market_data_demo.py

See the benchmark results for performance and memory comparisons between DuckPD and pandas across 100 MB, 1 GB, and 5 GB datasets.

Development

uv sync --frozen --group dev
make check
make build

GNU Make is optional. The equivalent commands are:

uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv build

See the documentation index for the implementation roadmap, architecture decisions, benchmarks, research, and changelog.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duckpd-0.0.3.tar.gz (145.9 kB view details)

Uploaded Source

Built Distribution

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

duckpd-0.0.3-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file duckpd-0.0.3.tar.gz.

File metadata

  • Download URL: duckpd-0.0.3.tar.gz
  • Upload date:
  • Size: 145.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for duckpd-0.0.3.tar.gz
Algorithm Hash digest
SHA256 62165976ec2f04b2e9a85bff5da4eff49fffbc0d64cdcf2cfb16f2f20b554ae2
MD5 f133465d4de3e881d81d388da2b29ed4
BLAKE2b-256 3cad131383b7f45e84c79737e3ff8457c1b4f22b5f109c6cfe4c008016385bcc

See more details on using hashes here.

File details

Details for the file duckpd-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: duckpd-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 32.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for duckpd-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8100743f961c0441dc766a720b04695ba16e36a4d55ac66b1fd9c83e50754b57
MD5 5a4224c0246815e6f7bec8ea819b82a6
BLAKE2b-256 6d5c58f5e6f17b73fbb049d1c9ebedfb0ac3f820b8bc266755cac5fae742880b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.0.7

2 files

0.0.5

2 files

0.0.4

2 files

This release

0.0.3 This release

2 files

0.0.2

2 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