Skip to main content

pytae

PyPI Python CI License

Fast, ergonomic Pandas tools and zero-code CLI for tabular data manipulation, feature engineering, DuckDB SQL, and visualization.

pytae offers one and only one right way to perform every tabular operation across two complementary workflows:

  1. Python Library & DataFrame Accessor (df.pt): Expressive, chainable verbs (filter, select, mutate, arrange, distinct, by, ungroup, pick, agg, long, wide, pivot, sql, plot) on standard Pandas DataFrames.
  2. Unix Pipeline CLI (pytae): Inspect, filter, transform, aggregate, diff, and export files (.parquet, .csv, .tsv, .jsonl, .sas7bdat, .gz) from the terminal with zero boilerplate.

👉 New to Pytae? Check out Pytae vs. Pandas vs. dplyr (Rosetta Stone & Naming Rationale).


Installation

pip install pytae              # Core library and CLI
pip install "pytae[plot]"       # Includes matplotlib for plotting
pip install "pytae[sql]"        # Includes DuckDB for SQL queries
pip install "pytae[plot,sql]"   # All optional dependencies

Quick Start: Python Library

Use verbs as standalone functions (pt.verb(df, ...)) or chain them via .pt:

import pytae as pt

penguins = pt.sample("penguins")

# Clean, method-chainable pipeline with zero index wrestling
summary = (
    penguins
    .pt.filter(lambda d: d["body_mass_g"] >= 3500)
    .pt.by("species")
    .pt.mutate(
        mass_kg="body_mass_g / 1000",
        avg_mass="mean(body_mass_g)",
        diff="body_mass_g - avg_mass",
    )
    .pt.arrange("species, -mass_kg")
    .pt.select("species", "island", "mass_kg", "diff")
    .pt.agg(mean_mass="mass_kg:mean", n="n")
)

👉 Full Library API Hub: docs/library.md


Quick Start: CLI

Flags execute from left to right as an in-memory pipeline:

# 1. Zero-cost inspection (reads Parquet headers without loading rows)
pytae penguins.parquet -shape -head 5

# 2. Filter, engineer features, sort, and export
pytae penguins.parquet \
  -filter "species = 'Adelie', body_mass_g > 3500" \
  -mutate "mass_kg = body_mass_g / 1000" \
  -arrange "mass_kg desc" \
  -select "species,island,mass_kg" \
  -o heavy_adelie.csv

# 3. Grouped aggregation & reshaping
pytae penguins.parquet -by species -agg "avg_mass=body_mass_g:mean, count=n"

# 4. Deduplicate rows across key columns
pytae penguins.parquet -distinct "species,island"

# 5. Embedded DuckDB SQL
pytae sales.parquet -sql "select region, sum(revenue) from data group by 1"

# 6. Fast dataset comparison
pytae current.parquet -diff baseline.parquet

👉 Full CLI Reference Hub: docs/cli.md


Key Syntax & Conventions

Operation Python (df.pt) CLI Flag Example
Filter Rows .pt.filter(...) -filter "..." df.pt.filter(lambda d: d['mass'] > 4000)
Group Context .pt.by(*cols) -by ... df.pt.by("species", "island")
Clear Grouping .pt.ungroup() N/A df.pt.ungroup()
Drop Null Rows df.dropna(...) -dropna [COLS] pytae data.parquet -dropna "age,income"
Sort Rows .pt.arrange(...) -arrange "..." df.pt.arrange("species, -mass_kg")
Pick Rows .pt.pick(...) -pick "..." df.pt.pick("mass", n=3, order="max")
Select Columns .pt.select(...) -select "..." df.pt.select("species", contains="bill", "-temp")
Mutate Columns .pt.mutate(...) -mutate "..." df.pt.mutate(ratio="[bill length] / [bill depth]")
Grouped Summary .pt.agg(...) -by ... -agg "..." df.pt.by("species").pt.agg(avg_mass="mass:mean", n="n")
2D Pivot Table .pt.pivot(...) -pivot "..." df.pt.pivot(r="island", c="species", v="mass", a="mean")
Pure Reshape .pt.long(), .pt.wide() -long, -wide df.pt.wide(c="metric", v="val", index="id")
Distinct Rows .pt.distinct(*cols) -distinct [COLS] df.pt.distinct("species", "island")
DuckDB SQL .pt.sql("...") -sql "..." df.pt.sql("select * from data order by 1")
Glimpse Table .pt.glimpse() -glimpse df.pt.glimpse()
Copy to Clipboard df.to_clip() -o clip df.head().to_clip()

Documentation Directory

Guides & Specifications

Interactive Jupyter Notebook Tutorials (docs/library/)

Run any interactive walkthrough directly:


License

MIT License. See LICENSE for details.

Metadata

Release files for pytae 3.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytae 3.8.1
File Size Uploaded Provenance
pytae-3.8.1.tar.gz 3.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pytae 3.8.1
File Interpreter ABI Platform
pytae-3.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.1 MB

Release files / pytae-3.8.1.tar.gz

Download URL pytae-3.8.1.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b96512f55d581893a929d6536b530f24422a1b0046cb8ecbb637999cc522a574
BLAKE2b-256 checksum
How to use checksums
9d69434d385a613702b24cfb2d933ccac6a82b6ae12c2bf61f77448fdcd1dd3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pytae-3.8.1-py3-none-any.whl

Download URL pytae-3.8.1-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
57aeec38e44ab575c3ab0577f68489c54ebf437577e970ac50e70f47ffe1d3c7
BLAKE2b-256 checksum
How to use checksums
22bd471c05186230bc130fa80c60794cc81d1f9a4f1172c40161f7405dd32835
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for pytae 3.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

3.8.1 This release

2 release files No provenance

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