Skip to main content

A data analysis cli tool using polars lazyframes

Project description

pldatacli

A simple command-line tool for quick CSV data analysis.


Tech Stack

  • Polars – fast DataFrame engine with lazy execution for efficient data processing
  • Typer – modern CLI framework for building command-line interfaces
  • Rich – beautiful terminal rendering for clean table output

Usage

Basic command

pldatacli FILE [OPTIONS]

Example file:

SampleSuperstore.csv

Filter rows

pldatacli SampleSuperstore.csv \
  --filter "State=Texas"

Multiple filters:

pldatacli SampleSuperstore.csv \
  --filter "State=Texas" \
  --filter "Category=Furniture"

Group by columns

Single column:

pldatacli SampleSuperstore.csv \
  --groupby Region

Multiple columns:

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --groupby Category

Aggregations

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --agg "Profit=sum"

Multiple aggregations:

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --agg "Profit=sum,mean"

Multiple columns with aggregations:

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --groupby Category \
  --agg "Sales=sum,mean" \
  --agg "Profit=sum"

Sorting

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --agg "Profit=sum" \
  --sort "Profit_sum:desc"

Multiple sorts:

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --agg "Profit=sum" \
  --sort "Region:asc" \
  --sort "Profit_sum:desc"

Rounding results

Round float columns to 2 digits:

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --agg "Profit=mean" \
  --round 2

Custom rounding:

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --agg "Profit=mean" \
  --round 4

Full example

pldatacli SampleSuperstore.csv \
  --groupby Region \
  --groupby Category \
  --agg "Profit=sum,mean" \
  --sort "Profit_sum:desc" \
  --round 2

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

pldatacli-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

pldatacli-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pldatacli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4c54ee22c78ea64392280f03cd270b8ebd15d7998d4de3ef207db0dd43ca44c1
MD5 d637c442d9231fdac527a1d551b18f01
BLAKE2b-256 12f7ad929ec7136e9515176b9d5686dfc7048efc39f8b897aa5a1e6604bd9a0a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pldatacli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ca050f016c7219f5e41665cfa0757c68da6d15cfbd0dc972e7af48254dc95e3
MD5 9e8071bb85ca70a7ad7642df16eb99c9
BLAKE2b-256 f02724359d81217e69c5f17af10f5322124787374335d173e646e35c428a2368

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