DataSleuth
Live demo: Data-Steuth Repository: GitHub
Inspiration
Data is everywhere, but understanding it is not. Many people and small teams have CSV files full of sales, transactions, survey responses or operational records, yet they do not have the time or the statistical background to inspect every column, spot missing values, find duplicates or notice unusual records. The first pass of exploratory data analysis is repetitive, and it is exactly where many people get stuck.
We built DataSleuth to remove that barrier. The idea was simple: upload a CSV, get a clear report that explains what the data contains, what looks unusual and what deserves a closer look — without writing code or building charts by hand.
What it does
DataSleuth is a web app for exploratory data analysis. The user uploads a CSV file and receives a structured report:
- Data profiling: rows, columns, data types, descriptive statistics, missing values, duplicate rows and constant columns.
- Automatic visualization: histograms for numeric columns, bar charts for low-cardinality categories and scatter plots for numeric relationships.
- Anomaly detection: Isolation Forest over suitable numeric columns, with a contextual table of the most unusual rows.
- Intelligent insights: deterministic findings with a severity level and the evidence behind each one.
- Report summary: key metrics, the top finding and a reset action.
Everything runs in memory during the session. The file is never stored and is not sent to external services. The language of the interface and the insights is English.
How we built it
DataSleuth is a single Python application built with Streamlit. The interface is only the top layer; the analysis lives in small, testable modules:
data_loaderreads the CSV from memory, validates size, rows and columns, detects encoding and delimiter, and rejects malformed rows.data_profilerbuilds aProfileReportwith column types, nulls, duplicates, constant columns and numeric statistics.visualizerselects charts from the profile, applies limits and explains skipped columns.anomaly_detectorselects usable numeric columns, imputes missing values with the median, scales the data and runs Isolation Forest with a fixed random state.insights_generatorapplies deterministic rules and produces findings with evidence, severity and a stable order.
We used pandas and NumPy for processing, scikit-learn for the anomaly model and Plotly for interactive charts. The project is tested with pytest (101 tests), linted and formatted with Ruff, and runs in GitHub Actions. Dependencies are pinned for reproducible deployment.
The application enforces clear limits (50 MB, 200,000 rows and 200 columns) so a large file cannot exhaust the resources of a small deployment. Identifier-like integer columns are excluded from charts and anomaly detection to avoid meaningless results.
Challenges we ran into
- CSV files are messy. Encodings, BOMs, delimiters and malformed rows all needed explicit handling. One subtle bug: pandas can silently use the first field of a row as an index when a row has more fields than the header, shifting the data. We now treat that case as an error.
- Streamlit reruns the script constantly. We had to cache the loaded dataset and derived reports in session state, and avoid re-reading the file on every interaction.
- Clearing an uploader is not trivial. A versioned widget key lets the “Clear dataset” action truly reset the file instead of reloading it.
- Isolation Forest is noisy on small datasets. With
contamination="auto", the demo dataset flags more rows than a human would. We show the most unusual rows first and explain that the result is orientative, not a diagnosis. - Insights must be trustworthy. We deliberately used deterministic rules instead of a generative model. Every finding cites the metric that supports it, and the app never claims that an unusual row is an error or fraud.
- Time. We built the project under a tight hackathon deadline. That forced us to keep the scope small and prioritize the end-to-end experience over extra features.
Accomplishments that we're proud of
- A complete end-to-end pipeline: upload, validation, profiling, charts, anomaly detection, insights and summary.
- A clear privacy model: no persistence, no accounts and no external APIs.
- Evidence-based insights that are reproducible for the same dataset.
- 101 automated tests, including edge cases such as empty files, all-null columns, duplicate headers and single-column CSVs.
- A 100,000-row pipeline that runs in about 1.5 seconds locally.
- A responsive interface with a dashboard summary, interactive charts and a review table for unusual rows.
- CI and pinned dependencies, so the project is reproducible and ready to deploy.
What we learned
- Data quality is the hard part. Most of the work was not the model; it was making the input path safe and predictable.
- Determinism builds trust. A rule-based insight with a number attached is easier to defend than a fluent paragraph with no evidence.
- Small modules are easier to test. Keeping Streamlit out of the analysis modules made the test suite fast and focused.
- Edge cases are the product. Empty files, null columns, duplicate headers and malformed rows are exactly what real users bring.
- Scope is a feature. A focused MVP that works end to end is more valuable than a long list of half-finished features.
What's next for DataSleuth
- Support for Excel and JSON files.
- Export the report to PDF or HTML.
- Correlation analysis and more chart types.
- An optional, clearly labeled LLM-powered explanation layer, with explicit consent and no silent data sharing.
- A data-cleaning assistant that recommends fixes without applying them automatically.
- Dataset comparison and analysis history.
- User accounts, saved projects and a public API for the analysis engine.
The current version is the hackathon MVP: a focused, private and explainable first pass over a CSV file.
