pytae
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:
- Python Library & DataFrame Accessor (
df.pt): Expressive, chainable verbs (qry,select,mutate,arrange,slice_max,slice_min,agg,long,wide,pivot,sql,plot) on standard Pandas DataFrames. - 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.qry(species=["Adelie", "Gentoo"], body_mass_g=">= 3500")
.pt.mutate(
mass_kg="body_mass_g / 1000",
avg_mass="mean(body_mass_g)",
diff="body_mass_g - avg_mass",
by="species",
)
.pt.arrange("species, -mass_kg")
.pt.select("species", "island", "mass_kg", "diff")
.pt.agg(by="species", 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 \
-qry "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. Embedded DuckDB SQL
pytae sales.parquet -sql "select region, sum(revenue) from data group by 1"
# 5. 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.qry(...) |
-qry "..." |
df.pt.qry(species="Gentoo", mass="> 4000") |
| Drop Null Rows | df.dropna(...) |
-dropna [COLS] |
pytae data.parquet -dropna "age,income" |
| Sort Rows | .pt.arrange(...) |
-arrange "..." |
df.pt.arrange("species, -mass_kg") |
| Top/Bottom Rows | .pt.slice_max/min(...) |
-slice_max/min "..." |
df.pt.slice_max("mass", n=3, by="species") |
| 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.agg("species", 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") |
| Deduplicate Rows | df.drop_duplicates(...) |
-dedupe [COLS] |
pytae data.parquet -dedupe |
| 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
- Architecture & Rosetta Stone: Pytae vs. Pandas vs. dplyr (Rationale)
- Library API Guide: docs/library.md
- CLI Reference Hub: docs/cli.md
- CLI Feature Guides:
- Row Filtering (
-qry,-dropna, intervals, set membership) - Row Slicing (
-slice_max,-slice_min, top/bottom N per group) - Row Sorting (
-arrange,-col,desc, spaced columns) - Deduplication (
-dedupeacross all or specific column subsets) - Column Selection (
-select, negative drops, slices) - Mutating & Computing (
-mutate, conditionals, window calcs) - Reshaping (
-long,-widepure 1-to-1 unmelting) - 2D Pivot Tables (
-pivotwith flat 1D headers) - Aggregations & Grouping (
-by,-agg, grand totals) - Inspection & Metadata (
-shape,-cols,-meta,-freq,-hist,-value_counts) - Data Cleaning (
-clean_columns,-replace_values,-handle_missing) - DuckDB SQL (
-sql) - Plotting & Figures (
-plot,-finalize) - Dataset Diffing (
-diff) - File I/O & Export (
-o,-out_dir, STDIN, compression) - Multi-File Pipelines (
-file,-merge,-concat) - Other Utilities & Modifiers (
-nrows,-limit,-dlim,-encoding,-pretty,-round,-pager,-progress)
- Row Filtering (
Interactive Jupyter Notebook Tutorials (docs/library/)
Run any interactive walkthrough directly:
- Filtering:
qry.ipynb - Selection:
select.ipynb - Feature Engineering:
mutate.ipynb - Sorting:
arrange.ipynb - Slicing:
slice.ipynb - Deduplication:
dedupe.ipynb - Pure Reshaping:
reshape.ipynb - 2D Pivot Tables:
pivot.ipynb - Aggregation:
agg.ipynb - DuckDB SQL:
sql.ipynb - Plotting:
plotting.ipynb - Other Utilities:
other_utilities.ipynb
License
MIT License. See LICENSE for details.
Metadata
Release files for pytae 3.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pytae-3.8.0.tar.gz | 3.1 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytae-3.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.1 MB
Release files / pytae-3.8.0.tar.gz
| Download URL | pytae-3.8.0.tar.gz |
|---|---|
| Size | 3.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d0c2b1621e6e5eaed089c3cbd65954d85f3164641fda917e448bee3b07a6866
|
|
BLAKE2b-256 checksum How to use checksums |
94d8e1c08525ec47b5ee1a3d1d2338a8dfe43cfb66c3e80db428ee89531b05d6
|
| 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.0-py3-none-any.whl
| Download URL | pytae-3.8.0-py3-none-any.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a57fae5bf00e867aafcc967b45e97c29cf9c43db83d0ffe0e1e0205a1b93d243
|
|
BLAKE2b-256 checksum How to use checksums |
d8474682ba63a9a21a50ac9954be7dabb529ca6882915bdfdc4cee24263a073e
|
| 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.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.