Skip to main content

Integrated Analytics Platform - Descriptive, Diagnostic, and now Advanced Predictive ML with XGBoost & SHAP

Project description

BizLens 📊

Fast business descriptive analytics — Polars-first, beautiful charts, and normality comparison

BizLens is a Python analytics library designed for business analysts, teachers, and students. It provides:

  • ⚡ Zero-copy performance with Polars (10-100x faster than Pandas)
  • 📈 Instant descriptive statistics with Mean, Median, Mode, Skewness, IQR
  • 📉 Beautiful visualizations with Matplotlib & Seaborn
  • 🔬 Normality comparison — see how your data deviates from normal distribution
  • 🎓 Educational-friendly — Interactive demos for learning analytics concepts
  • 🌍 Framework-agnostic with Narwhals (works with Polars, Pandas, Dask, etc.)
  • 🤖 Advanced ML (v2.2.2) — Full support for XGBoost, SARIMA time-series, and SHAP explainability!

Quick Start

Installation

pip install bizlens

Basic Usage

import bizlens as bl
import polars as pl

# Create or load data
df = pl.read_csv("sales_data.csv")

# Instant analysis
bl.describe(df, plots=True, norm_compare=True)

Interactive Demo

import bizlens as bl

# Generate realistic business dataset
demo_data = bl.create_interactive_demo()

# Analyze with visualizations
bl.describe(demo_data, plots=True)

For Teachers & Students

import bizlens as bl

# Load pre-built sample data
data = bl.load_sample_business_data()

# Analyze and save plots as PNG files
bl.describe(data, plots=True, save_plots=True)

Why BizLens?

The Problem

Business analysts often assume revenue is "normally distributed," but it's usually log-normal (skewed). Standard averages mislead managers.

The Solution

BizLens shows side-by-side comparisons:

  • Left: Your actual data distribution
  • Right: How it compares to a standard normal curve

This teaches the "why" behind skewed data in a visually intuitive way.


Features

📊 Core Analytics

bl.describe(df, plots=True, bins=30, norm_compare=True)

Returns:

  • Shape: Dataset dimensions
  • Numeric Stats: Mean, Median, Mode, Std Dev, Range, IQR, Skewness
  • Missing Values: Count of NaN per column
  • Visualizations: Distribution + Normality plots (optional)

💾 Export Support

# Save analysis to CSV or Excel
bl.describe(df, export="output.csv")
bl.describe(df, export="output.xlsx")

🖼️ Chart Control

# Display plots in Jupyter/interactive mode
bl.describe(df, plots=True, save_plots=False)

# Save plots as PNG files (great for reports)
bl.describe(df, plots=True, save_plots=True)

Advanced Usage

Using the BizDesc Class

from bizlens import BizDesc

# Initialize with file path or DataFrame
bd = BizDesc("data.csv")

# Get detailed results
results = bd.summary(
    include_plots=True,
    bins=50,
    norm_compare=True,
    export="analysis.csv"
)

print(results['numeric_stats'])

Working with Different Data Sources

import polars as pl
import pandas as pd
import narwhals as nw

# Polars (zero-copy)
df_pl = pl.read_csv("data.csv")
bl.describe(df_pl)

# Pandas
df_pd = pd.read_csv("data.csv")
bl.describe(df_pd)

# From file path
bl.describe("data.csv")  # Auto-detects CSV
bl.describe("data.xlsx")  # Auto-detects Excel
bl.describe("data.parquet")  # Auto-detects Parquet

API Reference

bizlens.describe()

bl.describe(
    data,              # DataFrame or file path
    plots=False,       # Generate visualizations
    export=None,       # Export to file
    bins=30,           # Histogram bins
    norm_compare=True, # Compare to standard normal
    save_plots=False   # Save PNG instead of display
)

bizlens.BizDesc

from bizlens import BizDesc

bd = BizDesc(data)
result = bd.summary(include_plots=True)

bizlens.create_interactive_demo()

Generates sample business dataset with:

  • Transaction IDs
  • Geographic regions (East, West, North, South)
  • Revenue (exponential/skewed distribution)
  • Customer satisfaction scores (normal distribution)
  • Units sold (Poisson distribution)
  • Priority levels (categorical)

bizlens.load_sample_business_data()

Pre-loaded sample dataset (500 rows) for quick demos and testing.


Why Polars + Narwhals?

Feature Pandas Polars BizLens
Speed (1M rows) 1x (baseline) 10-100x ⚡ 10-100x
Memory High Low Low
Null handling ⚠️ Complex ✅ Simple ✅ Simple
Type safety Weak Strong Strong
Framework support Just Pandas Polars/Dask All (Narwhals)

Installation from Source

git clone https://github.com/yourusername/bizlens.git
cd bizlens
pip install -e ".[all]"

Requirements

  • Python 3.9+
  • polars >= 0.18.0
  • narwhals >= 0.8.0
  • pandas >= 1.5.0
  • numpy >= 1.23.0
  • scipy >= 1.9.0
  • matplotlib >= 3.6.0
  • seaborn >= 0.12.0
  • rich >= 13.0.0

Testing

# Install with test dependencies
pip install -e ".[all]"

# Run tests
pytest tests/

# Run with coverage
pytest --cov=bizlens tests/

Contributing

We welcome contributions! Please:

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

License

MIT License © 2026 Sudhanshu Singh


Acknowledgments

Built with:

  • Polars for blazing-fast data processing
  • Narwhals for dataframe interoperability
  • Rich for beautiful terminal output
  • SciPy for statistical functions
  • Matplotlib & Seaborn for visualization

Support

For questions, issues, or feature requests:


Happy analyzing! 📊

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

bizlens-2.2.3.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

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

bizlens-2.2.3-py3-none-any.whl (80.8 kB view details)

Uploaded Python 3

File details

Details for the file bizlens-2.2.3.tar.gz.

File metadata

  • Download URL: bizlens-2.2.3.tar.gz
  • Upload date:
  • Size: 91.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for bizlens-2.2.3.tar.gz
Algorithm Hash digest
SHA256 8896d1783eb6712f12ced42204967288b2b993b26761bfc847bbcc2e3020cbad
MD5 1869842a19073607bf532a0198f886fe
BLAKE2b-256 0cc3adda65684411ea92344915ddb6849fee251b2f6f8b047f437113054e9f4a

See more details on using hashes here.

File details

Details for the file bizlens-2.2.3-py3-none-any.whl.

File metadata

  • Download URL: bizlens-2.2.3-py3-none-any.whl
  • Upload date:
  • Size: 80.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for bizlens-2.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4cb9cd35defdbae9f0d434d60cf036994f9dde26ee9e8b31411a63743550ad4f
MD5 9e3fb511d08314d264825e7a12016eb4
BLAKE2b-256 8e987ccbec86ce1bd74b12e5fb0818d862208d94089c33b82800a86f031532f5

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