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.2.tar.gz (3.0 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.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pldatacli-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 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.2.tar.gz
Algorithm Hash digest
SHA256 82675cec5aca1a5d1f16a964d08f46bab0f492437f62cfb23a32f10bd3fd550f
MD5 e68737dd5bfe1aa5a7384eaf54f3d1bd
BLAKE2b-256 54af17479abd3a0a2bf18528fc7aac851906b8e3d5883581e0b70391f2688012

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pldatacli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a0cef5b322afb60e0f062b83971bb51b6916886fedbd3c437321dd9a7787d63
MD5 936d0ceb12b9c79a6a976eb62993df47
BLAKE2b-256 8dc176134ae4a90d12173ac80e920540e870ca2788d1992a28a53cb3a65d4883

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