excel-master-pro
[](https://github.com/onur18/Excel-Master-Pro/actions/workflows/ci.yml)
[](https://github.com/onur18/Excel-Master-Pro/releases)
[](https://github.com/onur18/Excel-Master-Pro/blob/main/LICENSE)
[](https://onur18.github.io/Excel-Master-Pro/demo.html)





## Live Demo
[Open the sample interactive dashboard](https://onur18.github.io/Excel-Master-Pro/demo.html)
---
# π EXCEL MASTER PRO (v2.2.0 β Modular Data Intelligence SDK, CLI, MCP & BI Platform)
**EXCEL MASTER PRO** is a local-first enterprise data intelligence platform available as a **Python SDK**, **Rich CLI**, **Model Context Protocol (MCP) Server**, and **Interactive SaaS Web UI**. It automatically analyzes complex, messy, and large-scale Excel and tabular datasets, detects 13 distinct business rule and data quality errors, cleans records safely with user confirmation and full undo history, merges multiple files via intelligent column mapping, and exports client-ready **Professional PDF, Interactive BI HTML, and Formatted Excel** packages in a single click or command.
---
## β¨ Key Features
### 1. Python SDK, CLI & AI Agent (MCP) Integration (`excel_master/`)
- **Programmatic Python SDK (`import excel_master`):** Clean, modular API (`inspect`, `detect_errors`, `clean`, `export_report`) to embed automated spreadsheet validation, cleaning pipelines, and reporting into any Python workflow without UI overhead.
- **Command-Line Interface (`excel-master`):** Terminal-native commands (`inspect`, `audit`, `clean`, `report`, `ui`, `mcp`) built with Rich summary tables and headless batch execution.
- **Model Context Protocol (`MCP`) Server:** Built-in MCP server (`excel-master mcp`) exposing spreadsheet inspection, error detection, cleaning, and report generation tools directly to AI agents (Claude Desktop, Cursor, Antigravity, etc.).
### 2. Linear / Raycast-Inspired Obsidian SaaS BI Dashboard (`ui/`, `dashboard/`, `utils/i18n.py`)
- **Bilingual Interface (`EN / TR` Switcher & URL Routing):** Instant one-click switching between English (`EN`) and Turkish (`TR`) across the categorized sidebar, persistent topbar, onboarding flow, smart column detection headers, and executive overview β supporting `?lang=en` and `?lang=tr` URL query parameters.
- **High-Craft Dark Obsidian SaaS Interface:** Built with an ultra-clean monochrome dark palette (`#09090B` / `#121215`), subtle hairline borders (`#27272A`), monochrome SVG icons, and a unified single-card drag-and-drop upload zone.
- **Categorized 11-Module Left Sidebar:**
- **WORKSPACE:** `Overview`, `Data Preview`, `Data Quality`
- **DATA ENGINE:** `Error Detector`, `Auto-Cleaning`, `Data Analysis`, `Charts`
- **OPERATIONS:** `Reporting`, `Batch Processing`, `Action History`, `Settings`
- **Persistent Topbar & Comparative KPIs:** Displays active file name, row Γ column dimensions, worksheet selector, quick file upload trigger, one-click **Generate Report** button, and 6 Before/After KPI cards (`Total Records`, `Total Columns`, `Missing Data Rate`, `Duplicate Records`, `Detected Errors`, `Data Quality Score`).
### 3. Advanced File Ingestion & Smart Column Detection (`core/file_reader.py`, `core/column_detector.py`)
- **Supported Formats:** `XLSX`, `XLS`, `XLSM`, `ODS`, `CSV`, `TSV`, `TXT`, `JSON`, `Parquet`.
- **Smart Header & Column Inference:**
- Automatically resolves shifted headers (not located on the first row), merged cells, and **two-tier (parent group + sub-header) Excel headers**.
- Assigns temporary identifiers (`Col_1`, `Col_2`, ...) to headerless files without dropping the first data row, inferring semantic column types (`Email`, `Phone`, `National ID`, `Date`, `City`, `Country`, `Gender`, `Status`, `Order/Customer ID`, `Full Name`, `Amount`, `Quantity`) from cell contents.
- Prompts the user for confirmation whenever prediction confidence is low; **never hallucinates or fabricates column names when true headers are unknown**, preserving temporary names and notifying the user.
### 4. Automated Error Detector (`core/error_detector.py`, `ui/error_detector.py`)
Automatically scans datasets across 13 core data quality and business rule error classes:
1. Malformed date formats
2. Invalid email addresses
3. Invalid phone numbers
4. Duplicate customer records
5. Negative stock quantities
6. Unexpected price values (`<= 0`)
7. Missing required fields
8. Inconsistent categories (casing, whitespace, and typo variants)
9. Text values in numeric columns
10. Statistical outliers (`IQR`)
11. Corrupted or malformed column names
12. Data type mismatches
13. Logical inconsistencies (`Start Date > End Date`, `Quantity Γ Unit Price β Total Amount`, invalid age or percentage values)
- Displays **Severity Level (`Critical` / `High` / `Medium` / `Low`)**, affected record count, sample values, recommended remediation, and an **Auto-Fix Confidence Score (`0β100%`)** for every detected issue.
- Provides a row-level **Before & After Comparison** preview; destructive actions (row deletion or overwriting) are never executed without explicit user approval.
### 5. One-Click Professional Report Generation (`ui/reports.py`, `exporters/`)
Client-ready deliverables generated in a single batch via the Web UI, CLI, SDK, or MCP:
- **Professional PDF Analysis Report (`.pdf`):** Cover page, file metadata, KPI cards, data quality score, missing value analysis, error detector breakdown, outlier analysis, statistical summary, high-resolution charts, chart commentary, pre/post-cleaning comparison, and overall evaluation (with full UTF-8 / Turkish character support).
- **Interactive HTML Dashboard (`.html`):** Self-contained, offline-capable SaaS BI visual analytics report.
- **Cleaned Excel Workbook (`.xlsx`):** Formatted output featuring conditional formatting, auto-filters, frozen header panes, quality summary, audit log, and quarantine sheets.
- **Data Quality Report (`.xlsx`)**, **Action History (`.xlsx`)**, **Injection-Safe CSV (`.csv`)**, and a **Single-File ZIP Package (`.zip`)**.
### 6. Multi-Excel Batch Processing (`core/batch_processor.py`, `ui/batch.py`)
- **MODE 1 (Clean & Report Separately):** Analyzes and safely cleans multiple files individually, generating dedicated Excel + HTML + PDF reports for each workbook.
- **MODE 2 (Smart Map & Merge into Master Table):** Automatically aligns synonymous columns across disparate files (`mΓΌΕteri_adΔ±`, `mΓΌΕteri adΔ±`, `Customer Name` β `Customer Name`), merging them into a unified table upon user confirmation while preserving source lineage (`Source_File`).
- **Fault Isolation:** A corrupted or unreadable file never halts processing for the rest of the batch; all outputs are delivered via a summary dashboard and a consolidated **ZIP** archive.
---
## ποΈ Project Architecture
excel_master_pro/
βββ app.py # Main Streamlit entry point (EN/TR switcher, categorized sidebar + Topbar)
βββ pyproject.toml # Package metadata, dependencies & `excel-master` CLI entrypoint
βββ config.py # Centralized SaaS BI configuration and Obsidian color palette
βββ run.bat # Windows one-click isolated venv setup & auto-browser launcher
βββ excel_master/
β βββ __init__.py # Public Python SDK exports
β βββ api.py # High-level programmatic SDK functions
β βββ cli.py # Rich-powered CLI (`inspect`, `audit`, `clean`, `report`, `ui`, `mcp`)
β βββ mcp_server.py # Model Context Protocol (MCP) tool server for AI agents
βββ core/
β βββ file_reader.py # Multi-format, multi-row/shifted-header ingestion engine
β βββ file_validator.py # Extension, magic-byte, zip-bomb, and macro validation
β βββ column_detector.py # Type inference, content-based header detection & canonical mapping
β βββ error_detector.py # 13-rule Automated Error Detector & Before/After preview
β βββ cleaning_engine.py # Recommendation, approval, quarantine & undo-safe cleaning engine
β βββ batch_processor.py # Multi-file MODE 1 & MODE 2 batch processing engine
β βββ anomaly_detector.py # IQR, MAD Z-score, Isolation Forest & integrity checks
β βββ data_profiler.py # Column-level statistical and structural profiler
β βββ data_analyzer.py # Data quality scoring and correlation analysis
β βββ data_transformer.py # Column operations, safe AST formulas, pivot & DuckDB SQL
β βββ file_comparator.py # Two-table/file comparison and diff analysis
βββ dashboard/
β βββ kpi_generator.py # 6 core KPI card generator with Before/After delta tracking
β βββ chart_generator.py # Priority-ranked BI charts, gauges & quality heatmaps
β βββ dashboard_builder.py # Smart analytical insights, category shares & dashboard assembler
βββ exporters/
β βββ pdf_exporter.py # 12-section enterprise PDF analysis report generator
β βββ html_exporter.py # Standalone interactive SaaS BI HTML dashboard exporter
β βββ excel_exporter.py # Formatted XlsxWriter workbook & diff report exporter
β βββ csv_exporter.py # Formula-injection-protected CSV exporter
βββ ui/ # 11 localized Streamlit page modules, shared Topbar/CSS & session state
βββ utils/
β βββ i18n.py # Centralized English/Turkish (EN/TR) localization & URL query routing
β βββ helpers.py # Number, date, and formatting utilities
β βββ validators.py # Input sanitization & safe filename guards
β βββ logger.py # PII-masked application logging
β βββ history.py # SQLite action history persistence
βββ tests/ # Comprehensive Pytest suite covering Core, UI, SDK, CLI & MCP
---
## π Installation & Usage
### 1. Install Package
pip install -e ".[all]"
### 2. Launch Web UI
**Windows (One-Click):**
run.bat
**Via CLI / Terminal:**
excel-master ui
### 3. CLI Usage
# Inspect file structure, inferred column types, and quality score
excel-master inspect sales_data.xlsx
# Run the 13-rule error detector audit
excel-master audit sales_data.xlsx
# Clean dataset and export formatted workbook
excel-master clean sales_data.xlsx -o cleaned_sales.xlsx
# Generate full PDF + HTML + Excel report bundle
excel-master report sales_data.xlsx -o ./reports
# Start the MCP server for AI agents
excel-master mcp
### 4. Python SDK Usage
import excel_master as em
# Inspect & audit a messy spreadsheet
summary = em.inspect("sales_data.xlsx")
errors = em.detect_errors("sales_data.xlsx")
# Clean safely and export client-ready reports
cleaned_df = em.clean("sales_data.xlsx", output_path="cleaned_sales.xlsx")
em.export_report("sales_data.xlsx", output_dir="./reports")
### 5. Running Tests
pytest -v
---
## π‘οΈ Security & Data Integrity Principles
- Uploaded files are processed **100% locally** on your machine; no data is ever transmitted to external networks.
- Original files remain untouched and are automatically backed up under `output/originals/`.
- No rows or columns are deleted without explicit user approval; modified or removed records are preserved in quarantine and can be restored anytime via **Undo**.
- VBA macros inside `.xlsm` workbooks are automatically detected and strictly blocked from execution.
## πΊοΈ Roadmap (`v2.3.0`)
- [ ] **Zero-Configuration Autonomous Adaptation Engine (`core/autonomous_engine.py`):** Automatically reconstruct shifted/multi-tier headers, normalize mixed TR/US currency and date formats, resolve transposed financial models, and quarantine unrecoverable rows without manual configuration.
- [ ] **One-Command Autopilot (`excel-master auto`):** Clean raw workbooks and generate interactive HTML + PDF executive BI dashboards straight from messy layouts via CLI, Python SDK, and MCP.
- [ ] **Dynamic PDF Table Wrapping (`exporters/pdf_exporter.py`):** Automatic text wrapping and dynamic column width allocation for wide tables.
TDQS
Scored across 4 tools
Each tool maps to a clearly distinct phase of spreadsheet work: inspection is read-only, cleaning repairs in place to a new output, merging combines multiple files, and reporting produces a BI artifact. Overlap is minimal because the action and input shape differ substantially, and the descriptions reinforce the boundaries.
All four tools follow a consistent verb_noun snake_case pattern: inspect_spreadsheet, clean_spreadsheet, merge_spreadsheets, generate_bi_report. The naming is predictable and readable with no mixed conventions.
Four tools is well within the appropriate range and each corresponds to a distinct, useful operation in the spreadsheet workflow. There is no redundant or filler tool, and the surface feels intentionally scoped.
The set covers inspection, cleaning, merging, and reporting, which are core lifecycle operations for spreadsheet processing. Minor gaps remain, such as direct filtering/querying, row-level editing, or conversion between tabular formats beyond report output, but agents can work around these for most common tasks.