A modular Python command-line application that analyzes CSV datasets using pandas. This project demonstrates real-world data processing, functional programming techniques, and clean software structure.
The Data Insights CLI Analyzer is a terminal-based tool that allows users to load, analyze, and extract insights from structured CSV data.
It is designed to simulate real-world data workflows such as:
- Data loading and validation
- Data exploration
- Data transformation
- Aggregation and filtering
- Error handling
The project follows a modular architecture, separating responsibilities across multiple components for better readability and scalability.
data-insight-cli-analyzer/
│
├── data/
│ └── sales_data.csv
├── images/
│ ├── aggregate-results.png
│ ├── data-insights-cli-analyzer.png
│ ├── data-type-checking.png
│ ├── dataset-preview.png
│ ├── discount.png
│ ├── exit-application.png
│ ├── filteting.png
│ ├── main-menu.png
│ ├── statistics.png
│ └── total-sales.png
├── utils/
│ ├── analyzer.py
│ ├── filter.py
│ └── loader.py
│
├── .gitignore
├── main.py
└── README.md
- Reads CSV files using pandas
- Handles missing or invalid file paths using error handling (
try/except)
- Displays dataset preview (
head) - Shows dataset structure (
info)
- Computes basic statistics using built-in functions:
min(),max(),sum(),sorted()
- Calculates total sales per record
- Applies category-based discounts using lambda functions + DataFrame[column].apply()
- Aggregates selected columns dynamically using
*args
- Filters dataset based on user input using
**kwargs
- Handles:
- Missing files
- Invalid column names
- Invalid data inputs
- Uses
try,except, andraise
- Displays data types using
type()
- Program starts and loads dataset
- User is presented with a CLI menu
- User selects an action
- Corresponding action processes the request
- Results are displayed in the terminal
- User returns to menu or exits
git clone https://github.com/your-username/data-insights-cli.git
cd data-insight-cli-analyzer
pip install pandas
python main.py
The project uses a sample dataset:
data/sales_data.csv
Columns:
- order_id
- customer_name
- category
- price
- quantity
- date
This project helped reinforce the following Python concepts:
- Working with modules and packages
- Data analysis using pandas
- Writing custom functions
- Using *args and **kwargs for flexible logic
- Functional programming with lambda
- Error handling using try, except, and raise
- Writing modular and maintainable code
- Building CLI-based applications









