Perform statistical analysis directly from your terminal. StatsLibX ships with a powerful command-line interface for quick data exploration, quality checks, and profiling — no Python code required.
Overview
The StatsLibX CLI provides fast, terminal-based access to the library's core functionality. After installation, the statslibx command is available globally in your shell. The internals now use dataclasses for structured configuration (v0.3.0). Every command follows the same structure:
statslibx <command> <file> [options]
The <file> argument accepts either a path to a local dataset (CSV, Excel, etc.) or one of the built-in sample dataset names (iris, titanic,mtcars, etc.). Run statslibx --help at any time to see the full list of available commands.
Commands
describe
Compute descriptive statistics for the given dataset. By default, it analyses all columns. Use flags to restrict the output to numeric or categorical columns only.
Signature
statslibx describe <file> [-n] [-c]
Parameters
file : str — Path to dataset or built-in dataset name-n, --numeric : flag — Show numeric columns only-c, --categorical : flag — Show categorical columns only
Examples
statslibx describe iris
# Output:
# sepal_length sepal_width petal_length petal_width
# count 150.000000 150.000000 150.000000 150.000000
# mean 5.843333 3.057333 3.758000 1.199333
# std 0.828066 0.435866 1.765298 0.762238
# min 4.300000 2.000000 1.000000 0.100000
# 25% 5.100000 2.800000 1.600000 0.300000
# 50% 5.800000 3.000000 4.350000 1.300000
# 75% 6.400000 3.300000 5.100000 1.800000
# max 7.900000 4.400000 6.900000 2.500000
statslibx describe titanic -n
statslibx describe titanic -c
quality
Generate a data quality report with missing-value counts, duplicate rows, and column-level diagnostics.
Signature
statslibx quality <file> [-v]
Parameters
file : str — Path to dataset or built-in dataset name-v, --verbose : flag — Show detailed per-column quality metrics
Examples
statslibx quality titanic
statslibx quality titanic -v
preview
Display a quick preview of the dataset. By default it shows the first 5 rows, but you can control the number of rows or request a random sample.
Signature
statslibx preview <file> [-n N] [-s]
Parameters
file : str — Path to dataset or built-in dataset name-n, --rows : int — Number of rows to show (default: 5)-s, --sample : flag — Return a random sample instead of the first rows
Examples
statslibx preview iris
# Output:
# sepal_length sepal_width petal_length petal_width species
# 0 5.1 3.5 1.4 0.2 setosa
# 1 4.9 3.0 1.4 0.2 setosa
# 2 4.7 3.2 1.3 0.2 setosa
# 3 4.6 3.1 1.5 0.2 setosa
# 4 5.0 3.6 1.4 0.2 setosa
statslibx preview iris -n 10
statslibx preview titanic -n 3 -s
info
View complete dataset information including column names, data types, memory usage, and null counts. Use the detailed flag for an extended report.
Signature
statslibx info <file> [-d]
Parameters
file : str — Path to dataset or built-in dataset name-d, --detailed : flag — Show extended info (types, nulls, memory, dtypes)
Examples
statslibx info titanic -d
# Output:
# Column Non-Null Count Dtype
# --- ------ -----
# survived 891 non-null int64
# pclass 891 non-null int64
# sex 891 non-null object
# age 714 non-null float64
# sibsp 891 non-null int64
# parch 891 non-null int64
# fare 891 non-null float64
# embarked 889 non-null object
# dtypes: int64(4), float64(2), object(2)
# memory usage: ~55.9 KB
data
Get a high-level summary of the dataset. Combine flags to see the statistical summary, data types, or missing-value information in a single view.
Signature
statslibx data <file> [-s] [-t] [-m]
Parameters
file : str — Path to dataset or built-in dataset name-s, --summary : flag — Show statistical summary (mean, std, min, max, etc.)-t, --types : flag — Display column data types-m, --missing : flag — Show missing-value counts per column
Examples
statslibx data titanic -t
# Output:
# survived int64
# pclass int64
# sex object
# age float64
# sibsp int64
# parch int64
# fare float64
# embarked object
statslibx data titanic -m
# Output:
# survived 0
# pclass 0
# sex 0
# age 177
# sibsp 0
# parch 0
# fare 0
# embarked 2
statslibx data titanic -s -t -m
Installation Verification
Confirm that StatsLibX is installed correctly and the CLI is on your PATH by running the welcome message:
statslibx
# Output:
# ╔══════════════════════════════════════════════╗
# ║ Welcome to StatsLibX v0.3.0 ║
# ║ Statistical Analysis for Data Science ║
# ╚══════════════════════════════════════════════╝
#
# Available commands:
# describe Descriptive statistics
# quality Data quality report
# preview Data preview
# info Complete dataset information
# data Dataset summary
#
# Run 'statslibx <command> --help' for detailed usage.
If you see the welcome banner above, you are ready to start analysing data from the terminal. The version number matches the installed Python package.
Example Workflows
Quick data exploration
Get a feel for a new dataset in seconds by chaining the most common commands:
# 1. Preview the data
statslibx preview titanic -n 5
# 2. Check data quality
statslibx quality titanic
# 3. Descriptive statistics for numeric columns
statslibx describe titanic -n
# 4. Profile categorical columns
statslibx data titanic -t -m
Analyse a local file
Point the CLI at any CSV or Excel file on your machine:
# Full description of a local CSV
statslibx describe "./data/sales_2024.csv"
# Quality report with verbose output
statslibx quality "./data/sales_2024.csv" -v
# Preview a random sample
statslibx preview "./data/sales_2024.csv" -n 10 -s
Quick comparison
Compare two built-in datasets side by side:
# Iris — balanced numeric dataset
statslibx info iris
# Titanic — mixed types with missing values
statslibx info titanic -d
Tip: Use statslibx <command> --help to view the full option list for any command directly in your terminal.