Skip to main content

A one-line autonomous exploratory data analysis (EDA) and reporting library.

Project description

๐Ÿš€ tom-analytics โ€” One-Line Autonomous Data Analytics & EDA Library

PyPI Version License: MIT Supported OS: Windows / macOS / Linux Python: 3.8+

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.
  • ๐Ÿ“Š 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 log1p or Yeo-Johnson are recommended if 0 or 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.
  • ๐ŸชŸ 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.stdout and sys.stderr are 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)

  1. Clone your repository:
    git clone https://github.com/OmkarSugave/tom.git
    cd tom
    
  2. 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


Download files

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

Source Distribution

tom_analytics-1.2.0.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

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

tom_analytics-1.2.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

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

Hashes for tom_analytics-1.2.0.tar.gz
Algorithm Hash digest
SHA256 473bcdcb9384b4082299d66fa539f43cf23956922af27dc2339a09dc5d32ee8a
MD5 c657d8894dce26b325b3551c912ca6b6
BLAKE2b-256 a60f91621b586fc808e2e07a9de1fd49915f5aa40e1303eb438a6d8eef62ca8e

See more details on using hashes here.

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

Hashes for tom_analytics-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08660cdb71203df3b9fcad0d39cd2af6d1bc4aae7e09f9dbf61767e4908cc838
MD5 3f690c48d63009a6c89363b0aedb24ef
BLAKE2b-256 3328944ab02bb32e9509bdc28aeb77cef0ff785cde2437d2db3392362dc0b970

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