Skip to main content

dplyr for Python: tidy piped verbs over polars and duckdb, with real autocompletion. Name reservation — API under active development.

Project description

dpyr

dplyr for Python. A tidy, pipe-style data manipulation API — fronting polars and duckdb — with real IDE autocompletion and dplyr-faithful semantics, verified by differential testing against dplyr itself.

from dpyr import read_parquet, col, n, desc, starts_with

(
    starwars
    .filter(col.height > 180, col.mass < 100)
    .mutate(bmi = col.mass / (col.height / 100) ** 2)
    .group_by(col.species)
    .summarize(
        n = n(),
        mean_bmi = col.bmi.mean(),
    )
    .arrange(desc(col.mean_bmi))
)

Principles (the elevator pitch)

  1. dplyr's vocabulary, Python's idiom. The verbs are dplyr's, verbatim (filter, mutate, select, arrange, group_by, summarize, joins, tidyselect). The pipe is Python's: method chaining.
  2. As lazy as possible internally, as eager as possible observably. Verbs build a plan; schema errors raise immediately on the offending line; displaying/exporting auto-collects. Interactive feel, query-engine performance.
  3. Autocompletion is a feature, not an accident. The col proxy and per-schema stub generation make column names and column-typed methods complete in any IDE.
  4. Two backends, one semantics. polars (in-memory/files) and duckdb (SQL pushdown) must agree, bit-for-bit modulo the documented semantics spec. Verified continuously.
  5. dplyr is the oracle. Compatibility is demonstrated, not claimed: golden outputs are generated by actual dplyr in CI.

Project documents

Doc What it pins down
docs/DESIGN.md API design, laziness/materialization model, autocompletion strategy, architecture
docs/SEMANTICS.md The conformance spec: every deliberate decision where R, polars and duckdb disagree
docs/TESTING.md Test strategy: dplyr-as-oracle, backend differential tests, Hypothesis properties
docs/ROADMAP.md Epics and stories to MVP, in dependency order

Status

Pre-MVP. The plan is in docs/ROADMAP.md.

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

dpyr-0.0.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

dpyr-0.0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file dpyr-0.0.1.tar.gz.

File metadata

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

File hashes

Hashes for dpyr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9d9be88c24f5e6973f3738697a4d6d9f845ce7830089f9a2c775cd27074283c0
MD5 03547c733ca8b5fb86cc92902b38cfbb
BLAKE2b-256 6040cb922bbfc5a6f962b18fce81ef797fe19c06b2ff9a0aadf1b8ab50784e67

See more details on using hashes here.

File details

Details for the file dpyr-0.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for dpyr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3f627f36fb0bd0b7b85ae8e6031e58ee3d4f626efa0cf459b1aa2af8ec017f1
MD5 3a920437e0e5e631de22216cf9b77e93
BLAKE2b-256 6eb15edf5053d3c4a7fef6297340c19a9af622d6ac907ac1f2d05234511f32c3

See more details on using hashes here.

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