Metadata-Version: 2.4
Name: framepipes-cli
Version: 0.1.0
Summary: Pipe-friendly CLI for rolling time-window sums
Author: Christoffer Lundman
License: MIT License
        
        Copyright (c) 2026 Christoffer Lundman
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Dynamic: license-file

# framepipes-cli

Pipe-friendly CLI collection for quick data transformations on CSV streams.
Small documentation tweak.

## Install

```bash
pip install framepipes-cli
```

To install from a local checkout:

```bash
pip install -e .[dev]
```

## Example

```bash
cat somedata.csv | fprolling 60min sum -t Time -v ValueColumn
```

Groupby aggregation:

```bash
cat somedata.csv | fpgroupby Category sum -v ValueColumn
```

Resample aggregation:

```bash
cat somedata.csv | fpresample 1D max -t Time -v ValueColumn
```

Filter rows with a query:

```bash
cat somedata.csv | fpquery "ValueColumn > 10"
```

Sort rows:

```bash
cat somedata.csv | fpsort Time
```

Drop columns:

```bash
cat somedata.csv | fpdrop ColA,ColB
```

Round float columns:

```bash
cat somedata.csv | fpround 2
```

Read SQL Server results:

```bash
cat query.sql | fpsqlread --server HOST --database DB --user USER --password PASS
```

Assign new columns:

```bash
cat somedata.csv | fpassign Total="Revenue - Discount" Ratio="Errors / Requests"
```

SQL Server notes:
- Requires `sqlalchemy` and `pyodbc` plus a system ODBC driver (e.g., ODBC Driver 18 for SQL Server).
- You can also pass a full SQLAlchemy URL via `--url`, for example:
  `mssql+pyodbc:///?odbc_connect=DRIVER%3D%7BODBC+Driver+18+for+SQL+Server%7D%3BSERVER%3DHOST%3BDATABASE%3DDB%3BTrusted_Connection%3Dyes`

## Notes

- Input must be CSV with header.
- Output is CSV with the datetime column plus all aggregated numeric columns.
- Missing values in aggregated columns are filled with 0.

## Sample data

See `example/README.md` for a runnable walkthrough using `example/sample.csv`.
