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.2

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.2
File Size Uploaded Provenance
pytae-3.8.2.tar.gz 3.1 MB Without provenance Details

Built distribution (wheel)

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

Total release size: 5.1 MB

Release files / pytae-3.8.2.tar.gz

Download URL pytae-3.8.2.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
422020e324c35f1f93d01982dc09a6439db9f4fa95e35863f24d84ec5738989d
BLAKE2b-256 checksum
How to use checksums
dbd837c1755e08993516e764bb4b205b11e6cc4248c8e65300a5e2841d5538b4
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.2-py3-none-any.whl

Download URL pytae-3.8.2-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2eb0454a79541ca3d02ba5b6510901191554e1ccd0a91866e8d4f687781b337a
BLAKE2b-256 checksum
How to use checksums
9dbd1ea8a1f079394f0b32622d503fd18bd19e4036cecd2c49d4d73af9f568e5
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.2

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.2 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