Metadata-Version: 2.5
Name: pytae
Version: 3.5.0
Summary: A package to enhance common tasks in data and plotting
Project-URL: Homepage, https://github.com/maddytae/pytae
Project-URL: Bug Tracker, https://github.com/maddytae/pytae/issues
Project-URL: CLI Docs, https://github.com/maddytae/pytae/blob/master/docs/CLI.md
Project-URL: Library Docs, https://github.com/maddytae/pytae/blob/master/docs/LIBRARY.md
Project-URL: CLI flags, https://github.com/maddytae/pytae/blob/master/docs/FLAGS.md
Author-email: Madhukar Kumar Jha <madhukar.k.jha@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: pandas>=2.0
Requires-Dist: pyarrow>=15.0.0
Provides-Extra: dev
Requires-Dist: duckdb>=0.9; extra == 'dev'
Requires-Dist: matplotlib; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Requires-Dist: scipy; extra == 'dev'
Provides-Extra: notebooks
Requires-Dist: ipykernel; extra == 'notebooks'
Requires-Dist: nbclient; extra == 'notebooks'
Requires-Dist: nbformat; extra == 'notebooks'
Requires-Dist: scipy; extra == 'notebooks'
Provides-Extra: plot
Requires-Dist: matplotlib; extra == 'plot'
Requires-Dist: scipy; extra == 'plot'
Provides-Extra: sql
Requires-Dist: duckdb>=0.9; extra == 'sql'
Description-Content-Type: text/markdown

# pytae

[![PyPI](https://img.shields.io/pypi/v/pytae.svg)](https://pypi.org/project/pytae/)
[![Python](https://img.shields.io/pypi/pyversions/pytae.svg)](https://pypi.org/project/pytae/)
[![CI](https://github.com/maddytae/pytae/actions/workflows/ci.yml/badge.svg)](https://github.com/maddytae/pytae/actions/workflows/ci.yml)
[![License](https://img.shields.io/pypi/l/pytae.svg)](https://github.com/maddytae/pytae/blob/master/LICENSE)

Pandas helpers for everyday data-science tasks (filtering, selection, reshaping, aggregation, plotting), plus a `pytae` CLI that exposes the same operations for inspecting and converting tabular files (`.parquet`, `.csv`, `.txt`, `.dat`, `.sas7bdat`) without writing any Python.

## Install

```bash
pip install pytae
```

## CLI

```bash
pytae data.parquet -head
pytae data.parquet -qry "species='Adelie'" -select "species,body_mass_g" -convert -o subset.csv
pytae data.parquet -sql "select species, avg(body_mass_g) from data group by species"
pytae -file "data1.parquet=df1; data2.parquet=df2" -merge "left=df1,right=df2,on=id"
```

See [docs/FLAGS.md](https://github.com/maddytae/pytae/blob/master/docs/FLAGS.md) for which flag to use, [docs/CLI.md](https://github.com/maddytae/pytae/blob/master/docs/CLI.md) for the full reference, and [docs/CLI_MULTI_FILE.md](https://github.com/maddytae/pytae/blob/master/docs/CLI_MULTI_FILE.md) for `-file`/`-merge`/`-concat`.

## Plotting

`Plotter`: method-chainable plots on top of `pandas.plot()` (`pip install pytae[plot]`).

```python
from pytae.plotting import Plotter

Plotter().data(penguins).plot(
    x="bill_length_mm", y="bill_depth_mm", kind="scatter", c="species", cmap="viridis"
).finalize()
```

See [docs/PLOTTING.md](https://github.com/maddytae/pytae/blob/master/docs/PLOTTING.md) for more examples with sample data.

## Library

Import `pytae as pt`. Same verbs work as `pt.select(df, ...)` or as `df.pt.select(...)` (mix with pandas: `df.rename(...).pt.agg_df(...)`). Notebooks use the accessor chain. CLI flags (`-select`, `-qry`, …) are unchanged.

```python
import pytae as pt
penguins = pt.sample("penguins")
pt.select(penguins, "species", contains="bill")
(penguins
 .pt.select("species", "island", "bill_length_mm", "body_mass_g")
 .pt.agg_df(a=["mean", "n"])
)
```

- **Filtering** — `pt.qry()`: keyword filters (equality, lists, `in`/`not in`, comparisons, intervals)
- **Selection** — `pt.select()`: columns by name, regex, dtype, or name pattern
- **Mutating** — `pt.mutate()`: create/overwrite columns via formulas, `if_else()`, `case_when()`, `map()`
- **Reshaping** — `pt.long()` / `pt.wide()`: melt numeric columns to rows, pivot back to columns
- **Aggregation** — `pt.agg_df()`: auto-detects group columns and aggregates the rest
- **Utilities** — `pt.to_clip()`, `pt.handle_missing()`, `pt.cols()`, `pt.group_x()`, `pt.clean_columns()`, `pt.replace_values()`
- **SQL** — `pt.sql()` / `df.pt.sql()` via duckdb (`pip install pytae[sql]`); the frame is table `data`

See [docs/LIBRARY.md](https://github.com/maddytae/pytae/blob/master/docs/LIBRARY.md) for examples of each.

## License

MIT — see [LICENSE](https://github.com/maddytae/pytae/blob/master/LICENSE).
