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. Unix Pipeline CLI (pytae): Fast one-shot command-line data processing, format conversion, and terminal visualizations.
  2. Interactive REPL Shell (pytae -i): Stateful in-memory workbench with $O(1)$ pointer-reassignment undo/redo, multi-table joins, and ANSI SQL.
  3. Python & Jupyter SDK (pt.DataFrame / df.pt): High-performance Polars-native DataFrame library with .pt accessor for pandas/polars DataFrames.

👉 Quick Links: CLI Cheat Sheet & Cookbook | Interactive REPL Guide | Master Reference & Architecture Hub | vs. Pandas | vs. dplyr | vs. SAS


Installation

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

Interactive REPL Shell (pytae -i)

Instead of re-reading multi-gigabyte files from disk on every command, the Pytae REPL loads datasets into memory once and provides an instantaneous interactive workbench with zero syntax bloat:

# Mode 1: Pre-load a dataset into the interactive shell
pytae penguins.parquet -i

# Mode 2: Launch an empty workbench (load multiple datasets on the fly)
pytae -i

Mode 1: Single-Table Exploration (pytae <file> -i)

Operate directly on the loaded table with zero prefixing:

pytae [penguins.parquet: 344x7]> -filter "species in ['Adelie', 'Gentoo'] and body_mass_g >= 3500"
-> penguins.parquet: 188 rows x 7 cols

pytae [penguins.parquet: 188x7]> -mutate "mass_kg = body_mass_g / 1000" -select "species,island,mass_kg"
-> penguins.parquet: 188 rows x 3 cols

# Non-destructive inspection (does not truncate active data)
pytae [penguins.parquet: 188x3]> -head 3
pytae [penguins.parquet: 188x3]> -shape

# Instant $O(1)$ rollback & snapshots
pytae> undo                      # Revert last step
pytae> checkpoint baseline       # Save named snapshot
pytae> restore baseline          # Revert to snapshot

Mode 2: Multi-Table Workbench (pytae -i)

Load multiple datasets and operate with clean subject-first commands (<tbl> -<cmd>):

pytae> df1 = orders.parquet
pytae> df2 = customers.parquet

# Subject-first inspection & transformations
pytae [df1, df2]> df1 -head 5
pytae [df1, df2]> df1 -filter "amount > 100"

# Multi-table joins & ANSI SQL
pytae [df1, df2]> df3 = df1 -join df2 on=cust_id
pytae [df1, df2, df3]> df4 = -sql "SELECT df1.order_id, df2.name FROM df1 JOIN df2 ON df1.cust_id = df2.id"

# Export specific table
pytae [df1, df2, df3, df4]> df3 -o merged_orders.parquet

👉 Read the Full REPL Manual: docs/detailed_docs/cli/repl.md


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 (reads headers without loading rows)
pytae penguins.parquet -head 5

# 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. Instant format conversion & dataset diff
pytae legacy.sas7bdat -o clean.parquet
pytae yesterday.parquet -diff today.parquet -tol 1e-4

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

👉 CLI Quick Reference: Cheat Sheet & Cookbook or run pytae -cheatsheet in your terminal! | Full CLI Manuals: docs/detailed_docs/cli/


Quick Start: Python & Jupyter SDK

Need the same expressive verbs in Python scripts, Airflow, or Jupyter? import pytae as pt gives you the exact same superpowers:

import pytae as pt

# Read directly with Polars-powered fast auto-detection
df = pt.read_parquet("sales_report.parquet")

# Or chain directly off pandas or polars - only one .pt call needed!
summary = (
    df.filter("amount > 0")
    .by("region")
    .mutate(pct_total="amount / sum(amount)", prev_sale="shift(amount, 1)")
    .arrange("amount desc")
    .to_pandas()  # or .to_polars(), .to_clip()
)

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 Guide: docs/detailed_docs/plotting/plotting.ipynb | CLI Plotting Guide


Documentation Directory

Architecture & Comparisons

Detailed Topic Guides (docs/detailed_docs/)

Topic Jupyter Notebook (docs/detailed_docs/library/) CLI Guide (docs/detailed_docs/cli/) Key Features / Verbs
Interactive REPL — CLI Guide pytae -i, df1 = file, -head, undo, checkpoint, -sql
Data Ingestion & Sinks Notebook CLI Guide pt.read_*, pt.scan_*, -o, -out_dir, -dlim, -encoding
Row Filtering Notebook CLI Guide filter, -filter, intervals, set membership, and/or
Feature Engineering Notebook CLI Guide mutate, -mutate, formulas, sequential assignments, map, if_else
Column Selection Notebook CLI Guide select, -select, negative drops !col, regex, pattern matches
Row Sorting Notebook CLI Guide arrange, -arrange, desc, bracketed spaced columns
Row Slicing Notebook CLI Guide head, tail, -head, -tail, top/bottom N or % per group
Distinct Rows Notebook CLI Guide distinct, -distinct, deduplication across column subsets
Aggregations & Grouping Notebook CLI Guide by, agg, -by, -agg, zero data loss retention
Relational Joins & Stacking Notebook CLI Guide join, concat, -join, -concat, colon keys on=k1:k2, how
Table Reshaping Notebook CLI Guide long, wide, -long, -wide, 1-to-1 unmelting, rcva grammar
2D Pivot Tables Notebook CLI Guide pivot, -pivot, r, c, v, a matrices, flat 1D headers
Visualizations & Plotting Notebook CLI Guide df.plot(), -plot, -finalize, mosaic dashboards, -freq, -hist, -bar
ANSI SQL Engine Notebook CLI Guide df.sql(), pt.sql(), -sql Polars SQL engine across tables
Data Masking & Privacy Notebook CLI Guide mask, unmask, -mask, -unmask, hash, salt, encrypt, redact
Dataset Inspection & Diff Notebook CLI Guide fillna, dropna, diff, -diff, -tol, -shape, -cols, -dtype
Multi-File & Batch Pipelines Notebook CLI Guide -file, multi-table pipelines, batch globbing, UNIX pipes

License

MIT License. See LICENSE for details.

Metadata

Release files for pytae 3.12.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.12.2
File Size Uploaded Provenance Actions
pytae-3.12.2.tar.gz 3.5 MB Without provenance Details for pytae-3.12.2.tar.gz

Built distribution (wheel)

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

Total release size: 5.7 MB

Release files / pytae-3.12.2.tar.gz

Download URL pytae-3.12.2.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
5daaaa69ef887c640cdc65c0beba3bd506e6e629398a34f5ea1be5b0a597bd7f
BLAKE2b-256 checksum
How to use checksums
8b525441fa8eaa1aac5dd43482a8c3284800c27461db60d508ee07aa09657668
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.12.2-py3-none-any.whl

Download URL pytae-3.12.2-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a5ac3c1780b37abc0912a8fc5b89b907b6be7a8f5de8389f324f5bcb552489c6
BLAKE2b-256 checksum
How to use checksums
3fc1b3461dcd2af588fa80c96b7f56e0baa7ec04e0d73338161470378dfa21e8
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.12.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.

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

Release history Release notifications | RSS feed

This release

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