Skip to main content

pytae

PyPI Python CI License

Fast, ergonomic tabular data manipulation, feature engineering, and visualization powered natively by Polars for multithreaded SIMD vector computation and backed by Pandas & Matplotlib for plotting across command-line, interactive shell, and Python library.

pytae provides one and only one obvious way to work with tabular data across three unified modalities:

  1. Python & Jupyter SDK (pt.DataFrame / df.pt): High-performance Polars-native DataFrame library with .pt accessor for pandas/polars DataFrames.
  2. Unix Pipeline CLI (pytae): Fast one-shot command-line data processing, format conversion, and terminal visualizations.
  3. IPython & Jupyter Workbench (import pytae as pt): Auto-activated magics (%pt/%%pt, %checkpoint, %restore, %status, %free, %set, %export, %exit -s) with disk-backed checkpoints and OS RAM reclaiming.

👉 Quick Links: CLI Cheat Sheet & Cookbook | IPython & Jupyter Workbench Guide | Master Reference & Architecture Hub | vs. Pandas | vs. dplyr | vs. SAS | Benchmarks (5M Rows)


The Pytae Advantage: "One and Only One Obvious Way"

Architectural Dimension Legacy Workflows (Pandas / dplyr / SAS) Pytae Guarantee
API Philosophy 4–6 competing ways per task (query, loc, assign, [], NSE) One canonical verb per operation (filter, mutate, arrange, select, agg)
Index Hierarchy Complex row indexes, MultiIndex tuples, constant .reset_index() Pure flat 1D DataFrames: clean RangeIndex(0, 1, 2, ...) always
Data Safety Silent loss: groupby(dropna=True) drops groups; dropna() wipes partials Zero Data Loss: bare dropna() drops 100% blanks; agg/pivot retain NA groups
Grouping Scope Sticky grouped state requiring defensive ungroup() Single-shot grouping: df.by(*cols) scopes the immediate verb and auto-resets
Execution Engine Single-threaded Python GIL / memory-copy bottlenecks 100% native multithreaded Polars Rust SIMD core with predicate pushdown
Modality Parity Disconnected CLI tools, incompatible shell scripts 100% grammar symmetry: df.filter(...) in Python == -filter "..." in terminal

Installation

Option 1: Zero-Config Global CLI via uvx or pipx (Instant, No Virtualenv Needed)

Run commands immediately anywhere in your terminal without setting up or activating virtual environments:

# Instant zero-install one-liner (executes in milliseconds via uv):
uvx pytae sales.parquet -filter "revenue > 1000" -shape

# Or install permanently into an isolated CLI tool environment:
uv tool install pytae     # via uv
# or
pipx install pytae        # via pipx

Option 2: Standard Python Package Installation

pip install pytae              # Polars-native CLI, IPython workbench, and Python library
pip install "pytae[plot]"       # Includes matplotlib for plotting & dashboards

1. Quick Start: Python & Jupyter SDK

Need expressive, readable data transformations in Python scripts, Airflow, or Jupyter? import pytae as pt gives you fluent method chaining backed by multithreaded Rust:

import pytae as pt

# Read files, globs, lists, or partitioned directories with Polars-powered fast auto-detection
df = pt.read("sales_report.parquet")
# or pt.read(["jan.parquet", "feb.parquet"])
# or pt.scan("data/**/*.csv")

# Fluent method chaining
summary = (
    df.filter("amount > 0")
    .by("region")
    .mutate(pct_total="amount / sum(amount)", prev_sale="shift(amount, 1)")
    .arrange("amount desc")
    .to("summary.parquet")  # output to disk and returns self
)

# Export to in-memory formats with zero friction
records = summary.to("records")  # FastAPI/JSON dicts: [{"region": "East", ...}]
tbl = summary.to("arrow")        # Zero-copy PyArrow Table
pdf = summary.to("pandas")       # Pandas DataFrame

Visualizations & Dashboards (Compute in Polars, Visualize in Pandas)

While Polars provides multithreaded SIMD speed for transformations, Pandas and Matplotlib provide the richest visualization ecosystem. Calling .plot() automatically converts prepared data into Pandas and delegates directly to pandas.DataFrame.plot():

import pytae as pt

penguins = pt.sample("penguins")

# 1. Fluent method chaining
(
    penguins
    .filter("body_mass_g.is_not_null()")
    .by("species")
    .agg(avg_mass="body_mass_g:mean")
    .plot(kind="bar", x="species", y="avg_mass", title="Average Penguin Mass (g)")
    .finalize(save="mass_by_species.png")
)

# 2. Multi-panel dashboard layouts with pt.Plotter
plotter = pt.Plotter("""
    AAAB
    AAAC
""", figsize=(12, 6))

plotter.add("A", penguins, kind="scatter", x="bill_length_mm", y="bill_depth_mm", color="species")
plotter.add("B", penguins.by("species").count(), kind="bar", x="species", y="n")
plotter.add("C", penguins, kind="box", y="body_mass_g", by="species")
plotter.finalize(title="Penguin Morphology Dashboard", save="dashboard.png")

👉 Plotting Guides: Plotting Notebook | CLI Plotting Guide


2. Quick Start: Command-Line (CLI)

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

# 1. Zero-cost inspection & schema summary (columns, types, nulls %, unique count)
pytae penguins.parquet -schema
pytae penguins.parquet -head 5
pytae penguins.parquet -sample 5% -seed 42

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

# 3. Frequency tables, terminal ASCII visualizations & ANSI SQL
pytae penguins.parquet -freq species -bar
pytae sales.parquet -sql "SELECT region, sum(revenue) FROM data GROUP BY 1"

# 4. Multi-file relational operations (-join, -concat)
pytae ord=orders.parquet cust=customers.csv \
  -join "left=ord,right=cust,on=customer_id,how=left" -head 5

# 5. Instant format conversion & dataset diff
pytae legacy.sas7bdat -o clean.parquet
pytae yesterday.parquet -diff today.parquet -tol 1e-4

# 6. Sensitive PII masking and encryption
pytae users.csv -mask "email=hash, ssn=encrypt" -key "SecretKey123" -o secure.parquet

# 7. One-command shell tab-completion setup (Zsh, Bash, Fish)
pytae --install-completion

👉 CLI Quick Reference: Cheat Sheet & Cookbook or run pytae -cheatsheet in your terminal! | Full CLI & Engine Guides: docs/guides/


3. Quick Start: IPython & Jupyter Workbench (import pytae as pt)

Just import pytae as pt inside IPython or Jupyter — all workbench magics, display formatters, and context-aware Tab completions activate automatically (no %load_ext needed):

import pytae as pt

# Load data via Python or %pt (immutable by default)
df = pt.sample("penguins")
# or: df = %pt sales.parquet

# Run full Pytae CLI pipelines in-process without mutating `df`
heavy = %pt df -filter "body_mass_g > 4000" -arrange "body_mass_g desc"

# Multi-line pipeline cell magic (`%%pt <target_var>`)
%%pt summary
df
-dropna "body_mass_g"
-by "species, island"
-agg "avg_mass = mean(body_mass_g), n = count()"
-arrange "avg_mass desc"

# Ephemeral Arrow IPC checkpoints (0 MB RAM), strict rollback & OS RAM reclaim
%checkpoint raw
%status                         # Tracked tables, RAM, checkpoints, OS RSS, settings
%checkpoint diff df raw         # Compare current `df` vs checkpoint `raw`
%restore raw                    # Strict DataFrame rollback + OS RSS trim
%free heavy                     # Delete `heavy`, scrub IPython Out/_ cache & trim RAM

# Persistent display settings & clean script/notebook export
%set max_rows=20 float_precision=2 comma=true
%set save                       # Persists to ~/.pytae/config.json
%export analysis.py             # Standalone runnable .py (or .ipynb); prunes errors & rollbacks
%exit -s analysis.py            # Export and exit IPython cleanly

👉 Read the Full IPython Workbench Guide: docs/ipython.md


Ecosystem Rosetta Stone & Comparisons

Operation Pandas dplyr (R) SAS Pytae (Python & CLI)
Filter rows df[df['a'] > 1]
df.query('a > 1')
filter(df, a > 1) DATA out; SET in;
IF a > 1; RUN;
df.filter("a > 1")
pytae in.csv -filter "a > 1"
Add columns df['c'] = df['a'] + df['b']
df.assign(c=...)
mutate(df, c = a + b) DATA out; SET in;
c = a + b; RUN;
df.mutate(c="a + b")
pytae in.csv -mutate "c = a + b"
Grouped agg df.groupby('k').agg(...)
(MultiIndex hell)
df %>% group_by(k) %>%
summarise(...) %>% ungroup()
PROC MEANS DATA=in;
CLASS k; VAR v; RUN;
df.by("k").agg(avg="v:mean")
pytae in.csv -by k -agg "avg=v:mean"
Sort rows df.sort_values(['a', 'b'],
ascending=[True, False])
arrange(df, a, desc(b)) PROC SORT DATA=in;
BY a DESCENDING b; RUN;
df.arrange("a", "b desc")
pytae in.csv -arrange "a, b desc"
Cross-Tab Pivot pd.pivot_table(df, ...)
(Hierarchical tuples)
pivot_wider(df, ...) PROC TRANSPOSE DATA=in ...;
BY ...; RUN;
df.pivot(r='x', c='y', v='z')
pytae in.csv -pivot "r=x,c=y,v=z"

Detailed migration guides with line-by-line syntax comparisons:


Documentation Directory

Architecture, Philosophy & Ecosystem

Guides & Manuals


License

MIT License. See LICENSE for details.

Metadata

Release files for pytae 3.14.9

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.14.9
File Size Uploaded Provenance Actions
pytae-3.14.9.tar.gz 3.4 MB Without provenance Details for pytae-3.14.9.tar.gz

Built distribution (wheel)

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

Total release size: 5.4 MB

Release files / pytae-3.14.9.tar.gz

Download URL pytae-3.14.9.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
89f3a2a6e26d63f09590ee109ff57841d1997fd5ea2f472346af793d1fb3f3dd
BLAKE2b-256 checksum
How to use checksums
76af4d7dc3545b307f67a195061b8070db9fbfb0043a772bd859f1e141e8243c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL pytae-3.14.9-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
62fdba261b9397a454ed11ed75dd1961b2a099c15a95bb6714ad7ac54d105ec0
BLAKE2b-256 checksum
How to use checksums
ab40edc7391a6bfe1095a266a70d0a542c4691382deff88f52fef1b89ee355ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pytae 3.14.9

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.14.9 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