A one-line autonomous exploratory data analysis (EDA) and reporting library.
Project description
๐ tom-analytics โ One-Line Autonomous Data Analytics & EDA Library
tom (published as tom-analytics) is a zero-configuration, single-line automated exploratory data analysis (EDA) and diagnostics engine. Designed for developers, data scientists, and analysts, it handles everything from automatic file loading to sophisticated statistical tests, interactive Plotly visualizations, and premium glassmorphism HTML reportsโall from a single function call.
๐บ๏ธ How it Works (Under the Hood)
The library is designed to go from raw file to interactive, publication-ready report in one line. Here is the operational workflow:
graph TD
A[Raw File / DataFrame] -->|mos.file| B(Parser & Format Detector)
B -->|Automatic Type Inference| C(Cleaner & Imputer)
C -->|Auto-Impute / Drop Dups| D(Autonomous Stats Engine)
D -->|Parametric & Non-Parametric Tests| E(Visual Suite Generator)
E -->|Seaborn & Plotly Engines| F(Glassmorphic HTML Compiler)
F -->|Self-Contained Report| G[report.html & plotly_dashboard.html]
โจ Features & Capabilities
- ๐ Universal File Parser (
mos.file): Delimiter-independent parser supporting CSV, TSV, JSON, Excel, and Parquet. Features interactive path prompt and string-matching path suggestions. - ๐งน Autonomous Preprocessing & ID Isolation: Intelligent type coercion (dates, numerical objects), median/mode missing value imputation, automatic column pruning (drops column with $>50%$ missing values), and duplicate row filtering.
- Robust ID Isolation: Automatically identifies database identifiers, sequential row indices, and UUIDs (e.g.
roll_id,user_id). Preserves them in the active DataFrame to prevent downstream pipeline crashes, but completely isolates them from correlation heatmaps, ANOVA tests, and statistical summaries.
- Robust ID Isolation: Automatically identifies database identifiers, sequential row indices, and UUIDs (e.g.
- ๐ Multi-faceted Statistical Engine: Computes high-fidelity parametric/non-parametric metrics, Chi-Square tests for category associations, and ANOVA tests for continuous-categorical relationships.
- ๐จ Vibrant Visualizations Suite: High-res static plots (ECDF, Q-Q, violin, box plots, histograms, pairplots, missing value heatmaps) at 300 DPI alongside a fully interactive pan/zoom Plotly dashboard.
- ๐ก Context-Aware Analytics & NLP Insights: Generates 10โ20 plain-English mathematical diagnostics that avoid common automated EDA interpretation pitfalls:
- Math-Safe Transformation Suggestion: Checks numerical column bounds before suggesting log/Box-Cox transformations, ensuring
log1porYeo-Johnsonare recommended if0or negative values are present to prevent code crashes. - Heavy-Tails vs. Outliers: Automatically identifies power-law or log-normal distributions. Warns against blindly dropping outliers that are legitimate heavy-tail values, recommending robust scaling (
RobustScaler) instead. - Actionable Class Imbalance Advice: Highlights dominant categorical frequencies ($>70%$) and suggests precise code tactics, such as stratified splitting (
stratify=y), class weighting (class_weight='balanced'), and tracking F1-score/Precision-Recall rather than overall accuracy. - Subgroup Normality Checks: Conducts Shapiro-Wilk testing at the subgroup level of categorical features. If a distribution is non-normal overall but normal within subgroups, it notes that parametric tests (ANOVA, t-tests) remain statistically valid.
- Math-Safe Transformation Suggestion: Checks numerical column bounds before suggesting log/Box-Cox transformations, ensuring
- ๐ช Glassmorphic HTML Compiler: Renders a premium, self-contained, completely portable HTML dashboard (
./tom_report/report.html) utilizing elegant card spacing, backdrop blurs, dark purple-to-blue gradients, and collapsible diagnostic panels. - ๐ฅ๏ธ Windows CP1252 Fixes Out-of-the-Box: Process-level
sys.stdoutandsys.stderrare automatically reconfigured to UTF-8 to prevent any Windows encoding crashes when displaying terminal emojis.
๐ ๏ธ Installation
You can install the package directly from PyPI or locally in editable mode.
Option A: Install from PyPI (Recommended)
pip install tom-analytics
Option B: Local Developer Installation (Editable Mode)
- Clone your repository:
git clone https://github.com/OmkarSugave/tom.git cd tom
- Activate your virtual environment and install:
# Windows PowerShell .\venv\Scripts\Activate.ps1 pip install -e .
๐ Quickstart & Essential API Reference
Import tom as mos and unleash automated EDA immediately:
import tom as mos
# 1. Load your dataset (automatically handles format & paths)
mos.file("mock_data.csv")
# 2. Run the complete autonomous pipeline!
mos.describe()
๐ Deep API Reference
1. File Loading & Parse: mos.file(path=None)
Loads any tabular dataset. If no path is provided, it opens an interactive terminal dialogue.
# Direct path loading
mos.file("dataset.parquet")
# Delimiter, type, and encoding detection are completely autonomous.
# If you make a typo, tom will suggest the nearest file name!
2. Auto-Cleaning: mos.clean_report(df=None)
Runs and prints a detailed analysis of missing data, data types, duplicate rows, and imputed actions.
mos.clean_report()
3. Outlier Analysis: mos.outliers(df=None)
Runs an IQR-based boundary analysis across all numerical features, displaying lower/upper limits, min/max outliers, and percentages.
mos.outliers()
4. Association & Correlation: mos.correlation(df=None)
Calculates the Pearson correlation matrix for numerical features. Saves a publication-quality heatmap at ./tom_report/charts/single_correlation_heatmap.png and prints a formatted terminal table.
mos.correlation()
5. Automated Machine Learning Guide: mos.suggest(df=None)
Analyzes dataset dimensions, distribution, and types to recommend a classification or regression pipeline. Suggests the best-suited machine learning models (e.g., Random Forests, XGBoost, Ridge) and lists essential preprocessing rules.
mos.suggest()
6. Side-by-Side Comparison: mos.compare(df2, df1=None)
Compares two DataFrames (e.g., training vs. test, or original vs. cleaned) showing shapes, missing values, duplicates, and column overlaps.
import pandas as pd
df_test = pd.read_csv("test_dataset.csv")
mos.compare(df_test)
7. Exporting Reports: mos.export(format_type="pdf")
Exports your gorgeous glassmorphic HTML report into a standard PDF page.
mos.export("pdf")
Note: PDF export utilizes pdfkit (requires wkhtmltopdf on your system path).
๐ Package Architecture & Directory Structures
The codebase is highly modularized, clean, and extensible:
tom/
โโโ tom/
โ โโโ __init__.py # Global UTF-8 reconfiguration, state manager, and public API
โ โโโ loader.py # Autonomous format parses (CSV, TSV, Parquet, JSON, Excel)
โ โโโ cleaner.py # Imputers, duplicate drops, type inference engine
โ โโโ stats.py # Shapiro-Wilk, ANOVA, Chi-Square association engine
โ โโโ charts.py # 300 DPI Seaborn plots + base64 image compiler
โ โโโ insights.py # NLP-driven analytics alerts & warning rules
โ โโโ reporter.py # Glassmorphic HTML template builder & Plotly compiler
โ โโโ utils.py # Directory checkers, path string metrics
โโโ pyproject.toml # Build metadata & dependency declarations
โโโ requirements.txt # Standard pip freeze
โโโ README.md # Comprehensive documentation (this file)
โโโ tom_report/ # Generated output folder (auto-excluded in .gitignore)
โโโ report.html # Premium portable HTML report
โโโ charts/
โโโ plotly_dashboard.html # Interactive pan & zoom dashboard
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
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 tom_analytics-1.2.0.tar.gz.
File metadata
- Download URL: tom_analytics-1.2.0.tar.gz
- Upload date:
- Size: 34.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
473bcdcb9384b4082299d66fa539f43cf23956922af27dc2339a09dc5d32ee8a
|
|
| MD5 |
c657d8894dce26b325b3551c912ca6b6
|
|
| BLAKE2b-256 |
a60f91621b586fc808e2e07a9de1fd49915f5aa40e1303eb438a6d8eef62ca8e
|
File details
Details for the file tom_analytics-1.2.0-py3-none-any.whl.
File metadata
- Download URL: tom_analytics-1.2.0-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08660cdb71203df3b9fcad0d39cd2af6d1bc4aae7e09f9dbf61767e4908cc838
|
|
| MD5 |
3f690c48d63009a6c89363b0aedb24ef
|
|
| BLAKE2b-256 |
3328944ab02bb32e9509bdc28aeb77cef0ff785cde2437d2db3392362dc0b970
|