Skip to main content

Automated dataset analysis and exploratory data analysis (EDA)

Project description

statlens

Python package

statlens is a Python package for automated exploratory data analysis. It takes a dataset and produces statistical summaries, data quality checks, and a visual report with minimal code, so you can spend less time on repetitive analysis scripts and more time interpreting results.

It is intended for developers, data scientists, and students who want a fast first look at a new dataset before deciding how to clean it or model it.


Features

  • Dataset overview: row counts, column counts, and detected data types
  • Missing value analysis at the column level
  • Statistical summaries: mean, median, min, max, and categorical modes, including dedicated summaries for boolean and datetime columns
  • Data quality checks for duplicate rows, constant columns, skewed distributions, outliers, likely ID columns, and numeric values stored as text
  • Correlation analysis that highlights strong relationships between numeric variables
  • Automatic suggestions for the likely machine learning task (classification, regression, or clustering) based on the dataset's structure, along with the reasoning behind the guess
  • Visualizations covering correlation matrices, distributions, and missing value patterns
  • An exportable HTML dashboard containing the full analysis report
  • A command line interface and JSON export for use outside a Python script

Installation

Install the package using pip.

pip install statlens

Quickstart

Generate a full exploratory data analysis report in two lines of code.

import statlens

statlens.report("your_dataset.csv", output="eda_report.html")

AI Executive Summary (optional)

statlens can integrate with Google's Gemini to generate a plain-English executive summary of your dataset, describing likely use cases and calling out data quality concerns worth investigating.

To enable this feature, you need a free Gemini API key.

  1. Get a free API key from Google AI Studio.
  2. Set it as an environment variable on your machine.

Windows (PowerShell):

$env:GEMINI_API_KEY="your_api_key_here"

macOS/Linux:

export GEMINI_API_KEY="your_api_key_here"

Once the key is set, statlens detects it automatically and adds the AI summary to the HTML dashboard. If no key is found, this step is skipped and the standard statistical report is generated on its own, so the package works fully without it.

Your raw data is never sent to the model. Only statistical metadata, such as column names, missing value percentages, and summary statistics, is transmitted to generate the summary. Individual rows and values never leave your machine.

The generated HTML dashboard includes:

  • dataset statistics
  • visualizations
  • correlation analysis
  • data quality insights

Terminal Summary

If you only want a quick analysis printed to the terminal:

import statlens

results = statlens.analyze("your_dataset.csv")
print(results)

This works with CSV files, Excel files, and pandas DataFrames, and returns the same underlying results dictionary that powers the HTML report.


Command Line Usage

statlens can also be run directly from a terminal, without writing any Python.

statlens your_dataset.csv

This generates report.html in the current directory using the same defaults as statlens.report(...). The command accepts a few options:

statlens your_dataset.csv --output eda_report.html --json eda_results.json --no-ai
  • --output sets the path for the generated HTML report (default: report.html)
  • --json additionally writes the raw analysis results to a JSON file
  • --no-ai skips the optional Gemini executive summary, even if GEMINI_API_KEY is set, which is useful for quick or offline runs

Supported Data Sources

  • CSV files
  • Excel files
  • pandas DataFrames

Technical Requirements

  • Python 3.9 or higher
  • pandas
  • numpy
  • matplotlib
  • seaborn
  • scikit-learn
  • google-generativeai (used for the optional AI executive summary)

Project Structure

statlens
|
├── statlens
│   ├── __init__.py
│   ├── analyzer.py
│   ├── visualization.py
│   ├── llm_explainer.py
│   ├── report.py
│   ├── cli.py
│   ├── utils.py
│   └── templates
│       └── report_template.html
|
├── tests
│   ├── test_analyzer.py
│   ├── test_visualization.py
│   ├── test_llm_explainer.py
│   └── test_cli.py
|
├── pyproject.toml
└── README.md

Roadmap

Planned improvements include:

  • automatic feature importance analysis
  • dataset drift detection
  • interactive web dashboards
  • integration with Jupyter notebooks

Contributing

Contributions are welcome. If you would like to improve the package, feel free to open an issue or submit a pull request.

Steps:

  1. Fork the repository
  2. Create a new branch
  3. Implement your changes
  4. Submit a pull request

License

This project is licensed under the MIT License.


Author

Gaurav Raj Singh GitHub: https://github.com/gauravxsuvo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

statlens-0.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statlens-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file statlens-0.1.0.tar.gz.

File metadata

  • Download URL: statlens-0.1.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for statlens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 824b6a146080560cadd49e6381d8a3427106ebda00de772966b5f08ca75daa25
MD5 0f400838911b2e0ac17057dc4e461122
BLAKE2b-256 91c51c155d73138a508cb788d9944e16a1858b428d6d12b0aa6ed438aba06b81

See more details on using hashes here.

File details

Details for the file statlens-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: statlens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for statlens-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b7f7250136d3df8594b05ee7ccbaa6672f9e9819209369024e8f66edff56133
MD5 03f5b9fcd010aa939a5bb35885995ac8
BLAKE2b-256 6e12c7121023839faa07f48cd18d3581de3cc9204cde4254d0d29707d6dfe785

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page