Automated data-quality profiling: CLI, web app, and REST API for CSV intelligence reports.
Project description
🕵️ Data Detective
Automated data quality profiling in seconds. Point Data Detective at a CSV and get back an intelligent report: shape, data types, missing values, duplicates, outliers, correlations, distribution skew, ID-like columns, and actionable insights. Choose your interface: fast CLI for scripts and CI, browser-based web app for exploration, or REST API for integration.
Why Data Detective?
- Fast: profiles 1000+ rows in under a second
- Thorough: detects 20+ data quality issues (outliers, duplicates, high cardinality, mixed types, skew, etc.)
- Private: your data never leaves your machine; everything runs locally
- Flexible: use as a CLI tool, web app, Python library, or REST API
- Lightweight: no external ML services or cloud dependencies
Two ways to use it
- CLI:
data-detective analyze myfile.csv --htmlfor scripts and CI pipelines. - Web app:
docker compose upfor interactive exploration with live charts.
Both interfaces use the same profiling engine and produce identical reports.
Quick start
Web app (interactive, no command line needed)
The easiest way to explore a CSV:
git clone https://github.com/murs5l/data-detective.git
cd data-detective
docker compose up --build
Then open http://localhost:8000, drag and drop a CSV, and explore. The report includes:
- Data shape and types
- Missing value heatmap
- Column Explorer: drill down into any numeric column to see histogram, boxplot, and 5-number summary
- Outlier detection (IQR and MAD methods)
- Correlation heatmap for numeric column pairs
- Insights highlighted in plain English
The browser-based UI is designed for non-technical and technical users alike: actionable insights appear first, and granular technical details are tucked behind a "Full technical report" toggle.
Insights lead the report, color-coded by severity. |
Column Explorer: drill into one column at a time. |
Running without Docker: if you have Python and FastAPI installed:
pip install -e ".[api]"
uvicorn backend.app.main:app --reload
Then visit http://localhost:8000.
CLI (scripting and CI/CD)
Install locally for use in scripts and automated pipelines:
pip install data-detective-toolkit
data-detective analyze myfile.csv
The PyPI package is
data-detective-toolkit; the installed command isdata-detective.
See CLI docs below for all flags and output formats.
CLI reference
Installation
pip install data-detective-toolkit
macOS tip: if
data-detectivecomes back ascommand not foundright after installing, pip likely fell back to a--userinstall (common on macOS's system Python, since its site-packages isn't writeable) and the resultingbin/folder isn't on yourPATH. Two fixes:
- Recommended: install with pipx instead, which installs CLI tools in an isolated environment and wires up
PATHfor you. Run each line separately, then restart your terminal before the last step:brew install pipx pipx ensurepathpipx install data-detective-toolkit(No Homebrew? Usepython3 -m pip install --user pipxinstead of the first line.)- Or find where pip actually put it and add that to your
PATH:python3 -m site --user-baseThis prints something like/Users/you/Library/Python/3.9. Add<that path>/bintoPATHin~/.zshrc, then restart your terminal.
Basic usage
# Print a text summary to stdout
data-detective analyze myfile.csv
# Generate an interactive HTML report
data-detective analyze myfile.csv --html
# Output JSON for programmatic use
data-detective analyze myfile.csv --json | jq '.insights'
# Write to specific files
data-detective analyze myfile.csv --output-html reports/q1_data.html
Options
| Flag | Description | Example |
|---|---|---|
--json |
Print full report as JSON to stdout | data-detective analyze data.csv --json |
--html |
Generate report.html in current directory |
data-detective analyze data.csv --html |
--output-json |
Write JSON report to a specific file path | --output-json reports/profile.json |
--output-html |
Write HTML report to a specific file path | --output-html reports/profile.html |
--outlier-method |
Choose outlier detection: iqr or mad (default) |
--outlier-method iqr |
--quiet |
Suppress non-error progress messages | --quiet |
Examples
CI/CD pipeline: fail if data quality issues exceed a threshold
data-detective analyze incoming.csv --json | jq '.outliers_mad | length' | xargs -I {} bash -c 'exit {}'
Batch processing: profile all CSVs in a directory
for f in data/*.csv; do
data-detective analyze "$f" --output-html "reports/$(basename $f .csv).html"
done
Data validation: check for specific issues before ETL
data-detective analyze input.csv --quiet --json | jq '.high_cardinality_columns'
REST API (for integration)
When running the web app or backend API server, you can integrate Data Detective into your own applications.
Endpoints
POST /api/analyze – Analyze a CSV file, return JSON report
curl -F "file=@data.csv" "http://localhost:8000/api/analyze?outlier_method=mad"
Response: JSON object with all profiling data (see example below).
POST /api/analyze/html – Analyze a CSV file, return standalone HTML report
curl -F "file=@data.csv" "http://localhost:8000/api/analyze/html" > report.html
Response: A self-contained HTML file (no external dependencies).
GET /api/health – Health check
curl http://localhost:8000/api/health
Response: {"status": "ok", "version": "0.3.0"}
Python example
import requests
with open("mydata.csv", "rb") as f:
response = requests.post(
"http://localhost:8000/api/analyze",
files={"file": f},
params={"outlier_method": "mad"}
)
report = response.json()
print(f"Shape: {report['shape']}")
print(f"Insights: {report['insights']}")
print(f"Outliers detected: {report['outliers_mad']}")
JavaScript example
const formData = new FormData();
formData.append("file", csvFile); // File object from input[type=file]
const response = await fetch("/api/analyze?outlier_method=mad", {
method: "POST",
body: formData
});
const report = await response.json();
console.log(report.insights);
Full API documentation is available at /docs (Swagger UI) when the backend is running.
What it detects
Data Detective automatically flags 20+ data quality issues:
Structure & Completeness
- Shape (rows × columns) and column data types
- Missing values (count and percentage per column)
- Duplicate rows
- Duplicate columns (identical data, different names)
- Constant columns (no variation; e.g., all 1s)
- Near-constant columns (one value dominates 95%+ of rows; easy to miss since they "look" like they vary)
- Possible modeling target column (name-based, e.g.
target,label,churn,y)
Statistical Issues
- Outliers: IQR method (classic box-and-whisker) or MAD (robust for skewed data)
- Highly correlated numeric pairs
- Skewed distributions (heavy left/right tails)
- Kurtosis (fat tails or sharp peaks)
Data Type & Value Issues
- High-cardinality columns (likely IDs or keys)
- Mixed-type columns (e.g., numbers and strings in the same column)
- Unexpected negative values (e.g., negative
age,price,quantity) - Date-like values not parsed as datetime
Text Columns
- Length statistics (min, max, average)
- Blank or whitespace-only values
Aggregates
- Full numeric correlation matrix
- Histograms with bin edges and counts for numeric columns
- Five-number summary (min, Q1, median, Q3, max) per numeric column
- Per-column memory footprint (KB)
Output
- A 0-100 data health score with a documented, inspectable breakdown (not a black box)
- Plain-English actionable insights highlighting the most important issues
Architecture
The CLI, web app, and REST API are three interfaces over one profiling
engine, not three separate implementations. DataProfiler in
src/data_detective/profiler.py holds every detector (missing values,
outliers, correlations, the health score, etc.) and is the only place that
logic lives. The CLI calls it directly; the FastAPI backend wraps the exact
same class and exposes it over HTTP for both the web app and the REST API.
Add a detector once, and it's instantly available everywhere the tool is
used, no duplicated logic to keep in sync across surfaces.
data-detective/
├── src/data_detective/ # Core engine + CLI - the shared source of truth
│ ├── profiler.py # DataProfiler: every detector, the health score
│ ├── cli.py # `data-detective` command-line entry point
│ ├── loader.py # CSV loading, with encoding fallback for messy files
│ ├── html_report.py # Static HTML report renderer
│ └── report.py # Plain-text report printer (CLI default output)
├── backend/app/ # FastAPI wrapper around the same DataProfiler
│ ├── main.py # /api/analyze, /api/analyze/html endpoints
│ └── quick_scan.py # Optional Go fastscan integration
├── frontend/ # Dependency-free HTML/CSS/vanilla JS web app
├── tools/fastscan/ # Optional Go speed layer (instant CSV pre-scan)
├── tests/, backend/tests/ # Core engine tests, API tests
├── docs/ # README images/GIF, generated coverage badge
├── scripts/ # Small maintenance scripts (e.g. coverage badge)
└── .github/workflows/ # CI (tests, lint, typecheck, coverage) + release automation
The Go speed layer is a pure optimization, not a dependency: quick_scan.py
checks whether the fastscan binary is present and returns None cleanly
if it isn't, so the app works identically (just without the instant
pre-scan stat) on a plain pip install with no Go toolchain.
Development
# core engine + CLI
pip install -e ".[dev]"
pytest tests
# backend API
pip install -e ".[api]"
pip install -r backend/requirements-dev.txt
pytest backend/tests
# fastscan (Go speed layer)
cd tools/fastscan && go test ./...
CI runs all three (.github/workflows/tests.yml) on every push and PR.
Roadmap
- GitHub Action to run Data Detective as a data-quality gate in CI
- Support for additional sources (Parquet, JSON, database connections)
- Scheduled/hosted profiling for pipelines beyond ad-hoc uploads
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file data_detective_toolkit-0.4.0.tar.gz.
File metadata
- Download URL: data_detective_toolkit-0.4.0.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faec95ab8d0960bd591477ee28d456090ee58bc5c304e3e8050354927c5e3c9c
|
|
| MD5 |
f2ae6179b46cf0feccd1a078d70ddeee
|
|
| BLAKE2b-256 |
cc3c8d5008dfe2662fb039e805f701ab0ba0b4276d4fa7b4d1422163be199704
|
Provenance
The following attestation bundles were made for data_detective_toolkit-0.4.0.tar.gz:
Publisher:
release.yml on murs5l/data-detective
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
data_detective_toolkit-0.4.0.tar.gz -
Subject digest:
faec95ab8d0960bd591477ee28d456090ee58bc5c304e3e8050354927c5e3c9c - Sigstore transparency entry: 2187705435
- Sigstore integration time:
-
Permalink:
murs5l/data-detective@4fbc74eac3c7ca6705232eadf4d803f7c90b98a3 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/murs5l
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4fbc74eac3c7ca6705232eadf4d803f7c90b98a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file data_detective_toolkit-0.4.0-py3-none-any.whl.
File metadata
- Download URL: data_detective_toolkit-0.4.0-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f6f101cbdd3bb239b430d4a476bdf3692bec76455e09677fd55f4e5f2373552
|
|
| MD5 |
f959bd3a3035ab31b24fd34b4b79511b
|
|
| BLAKE2b-256 |
32ca7e56226a8603283669a46c3aaeac5344a33219b6f916c75a53c6df994b08
|
Provenance
The following attestation bundles were made for data_detective_toolkit-0.4.0-py3-none-any.whl:
Publisher:
release.yml on murs5l/data-detective
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
data_detective_toolkit-0.4.0-py3-none-any.whl -
Subject digest:
1f6f101cbdd3bb239b430d4a476bdf3692bec76455e09677fd55f4e5f2373552 - Sigstore transparency entry: 2187705483
- Sigstore integration time:
-
Permalink:
murs5l/data-detective@4fbc74eac3c7ca6705232eadf4d803f7c90b98a3 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/murs5l
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4fbc74eac3c7ca6705232eadf4d803f7c90b98a3 -
Trigger Event:
push
-
Statement type: