Skip to main content

pytae

PyPI Python CI License

Fast, ergonomic Pandas-based Python tools and high-performance Polars-based CLI for tabular data manipulation, feature engineering, SQL queries, and visualization.

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

  1. Python Library & DataFrame Accessor (df.pt) — 100% Pandas-Based: Zero external engine overhead. Operates directly on standard Pandas DataFrames with expressive, chainable verbs (filter, select, mutate, arrange, distinct, by, ungroup, pick, agg, long, wide, pivot, plot). Importing pytae in Python is pure Pandas and never loads Polars into memory.
  2. Unix Pipeline CLI (pytae) — 100% Polars-Based: Blazing-fast multithreaded SIMD vector engine. Ingests tabular files (.parquet, .csv, .tsv, .jsonl, .sas7bdat, .gz), filters, transforms, aggregates, reshapes, and executes analytical ANSI SQL queries (-sql) natively in Polars vector memory with zero boilerplate.

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


Installation

pip install pytae              # Core Pandas library and Polars-powered CLI
pip install "pytae[plot]"       # Includes matplotlib for plotting

Quick Start: Python Library (Pure Pandas)

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 (Polars-Powered)

Flags execute from left to right as an in-memory pipeline powered natively by Polars:

# 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. Polars SQL Query
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]")
Multi-Col Mutate .pt.mutate("(...) = ...") -mutate "(...) = ..." df.pt.mutate("(rev, cost)_usd = _ * 1.08")
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")
SQL Query (CLI) N/A (CLI only) -sql "..." pytae data.parquet -sql "select * from data order by 1"
Glimpse Table .pt.glimpse() -glimpse df.pt.glimpse()
ASCII Freq & Hist .pt.freq(), .pt.hist() -freq, -hist df.pt.freq("species"), df.pt.hist("mass:10")
Copy to Clipboard df.to_clip() -o clip df.head().to_clip()

Documentation Directory

Guides & Specifications

Library Feature Guides (docs/library/)

Explore step-by-step Python API guides with inline outputs:

CLI Feature Guides (docs/cli/)

Explore step-by-step CLI pipeline guides with terminal outputs:


License

MIT License. See LICENSE for details.

Metadata

Release files for pytae 3.9.0

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

Built distribution (wheel)

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

Total release size: 5.1 MB

Release files / pytae-3.9.0.tar.gz

Download URL pytae-3.9.0.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
d4b327dceda306ddd52679276899ae84235196869bce409ebad4258edc5431a5
BLAKE2b-256 checksum
How to use checksums
98b348a93335135e0e78139015a1f247376604ae645877a774e0e13e3bbf7159
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.9.0-py3-none-any.whl

Download URL pytae-3.9.0-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
57c406048dd6dc661a8347f476eb50c94f3bb046623c55249be54ca6cec3f0f4
BLAKE2b-256 checksum
How to use checksums
1e808a9e8c45aebc174075c72f389d485c8eca066713f9c6e377b012ff41544a
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.9.0

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