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 (filter,select,mutate,arrange,distinct,by,ungroup,pick,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.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]") |
| 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") |
| DuckDB SQL | .pt.sql("...") |
-sql "..." |
df.pt.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
- 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 (
-filter,-dropna, intervals, set membership) - Row Picking (
-pick, top/bottom N or proportion per group) - Row Sorting (
-arrange,-col,desc, spaced columns) - Distinct Rows (
-distinctacross 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 (
Library Feature Guides (docs/library/)
Explore step-by-step Python API guides with inline outputs:
- Filtering:
filter.md - Selection:
select.md - Feature Engineering:
mutate.md - Sorting:
arrange.md - Picking Rows:
pick.md - Distinct Rows:
distinct.md - Pure Reshaping:
reshape.md - 2D Pivot Tables:
pivot.md - Aggregation:
agg.md - DuckDB SQL:
sql.md - Plotting (Interactive Notebook):
plotting.ipynb - Other Utilities:
other_utilities.md
License
MIT License. See LICENSE for details.
Metadata
Release files for pytae 3.8.3
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.3.tar.gz | 3.1 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytae-3.8.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.1 MB
Release files / pytae-3.8.3.tar.gz
| Download URL | pytae-3.8.3.tar.gz |
|---|---|
| Size | 3.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
173297c199ea96d90017af1e95b201ad8f7ddfcdad84c5dbf21d6e37abf3f877
|
|
BLAKE2b-256 checksum How to use checksums |
e88e0f9ec1dd3690c916c71fa750b516f9b8ccfa53e003112f44b32873fce375
|
| 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.3-py3-none-any.whl
| Download URL | pytae-3.8.3-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3bcbe9ecf539774c2d5fba6f544b4dd4b89e789d5510a484b6c16ec46706241
|
|
BLAKE2b-256 checksum How to use checksums |
12062f89e19aa41539be5839697383dc6f769afc273e0f80460c7a2fe46b8d76
|
| 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.3
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.