Skip to main content

Pipe-friendly CLI for rolling time-window sums

Project description

framepipes-cli

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

Install

pip install framepipes-cli

To install from a local checkout:

pip install -e .[dev]

Example

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

Groupby aggregation:

cat somedata.csv | fpgroupby Category sum -v ValueColumn

Resample aggregation:

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

Filter rows with a query:

cat somedata.csv | fpquery "ValueColumn > 10"

Sort rows:

cat somedata.csv | fpsort Time

Drop columns:

cat somedata.csv | fpdrop ColA,ColB

Round float columns:

cat somedata.csv | fpround 2

Read SQL Server results:

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

Assign new columns:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

framepipes_cli-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

framepipes_cli-0.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file framepipes_cli-0.1.0.tar.gz.

File metadata

  • Download URL: framepipes_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for framepipes_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bce001751d36835d16dc3bbda921522bb5718e2f328bbdd89c563cf7729179eb
MD5 cf0831ca716a32bae7437e90e3d4f83b
BLAKE2b-256 a09d9daba7588c179b7f198add8229153e89fe87376edab7338ad3d82d224bba

See more details on using hashes here.

File details

Details for the file framepipes_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: framepipes_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for framepipes_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1cac7b76071085c21b090e97155334160a33716abcea489bb42cd7e5d9e0815
MD5 e386d86e92e9b13d47577c24e4af164b
BLAKE2b-256 5794e8d205813739d12e4d6918e16d860f2b0cd229727bd24652c173d5690a29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page