Metadata-Version: 2.4
Name: insightflow-ai
Version: 1.0.0
Summary: An autonomous AI data pipeline for cleaning, EDA, ML modeling, and business reporting.
Home-page: https://huggingface.co/insightflow
Author: InsightFlow AI Team
Author-email: contact@insightflow.ai
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pandas
Requires-Dist: scikit-learn
Requires-Dist: openai
Requires-Dist: joblib
Requires-Dist: openpyxl
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# InsightFlow 🚀

**InsightFlow** is an autonomous, end-to-end AI data pipeline designed to transform raw, messy datasets into fully trained Machine Learning models and C-Level Executive Business Reports—all with zero manual coding.

---

## 🌟 Features

- **AutoFix**: Automatically cleans messy data (missing values, outliers, duplicates) and normalizes columns using AI heuristics. Supports multi-sheet Excel files.
- **AutoEDA**: Generates stunning, dark-mode glassmorphism HTML reports with interactive `Chart.js` visualizations and AI data insights.
- **AutoModel**: Auto-detects target prediction columns, trains 12+ classification/regression `scikit-learn` models, evaluates them, saves the Champion model as `.joblib`, and generates an interactive leaderboard.
- **AutoReport**: Compiles all previous pipeline steps into a pristine, high-contrast HTML Executive Dashboard that features a one-click **PDF Export** button for business stakeholders.

---

## ⚙️ Installation

You can install InsightFlow directly via pip (if hosted on PyPI) or locally:

```bash
# To install locally from the source folder:
git clone https://github.com/yourusername/InsightFlow.git
cd InsightFlow
pip install -e .
```

---

## 🔑 Authentication (HuggingFace API Token)

InsightFlow uses the **GLM-5.2** LLM hosted on the HuggingFace Router. You must have a HuggingFace API Token.

**How to get your token:**
1. Go to [HuggingFace Settings -> Access Tokens](https://huggingface.co/settings/tokens).
2. Click **"New token"**.
3. Name it (e.g., `InsightFlow_Token`) and give it **Read** permissions.
4. Copy the token (it starts with `hf_...`).

---

## 📖 Quickstart Guide

Using InsightFlow is incredibly simple. You can import modules directly:

```python
from InsightFlow import autofix, autoeda, automodel, autoreport

# 1. Provide your token and data
HF_TOKEN = "hf_your_token_here"
data_path = "messy_sales_data.xlsx"

# 2. Automatically clean the data
clean_data = autofix(data_path, HF_TOKEN)

# 3. Generate Exploratory Data Analysis
eda_results, eda_insights = autoeda(clean_data, HF_TOKEN)

# 4. Train Models (AI auto-detects the target column!)
model_results, model_insights, trained_models = automodel(clean_data, HF_TOKEN)

# 5. Generate final C-Level PDF Business Report
autoreport(eda_results, eda_insights, model_results, model_insights, target_col="Target", hf_token=HF_TOKEN)
```

### The "One-Liner" Ultimate Pipeline
Don't want to run steps manually? Use the integrated `clean_and_analyze` wrapper!

```python
from InsightFlow.autofix import clean_and_analyze, set_hf_token

set_hf_token("hf_your_token_here")

# This one line does ALL of the above!
clean_and_analyze("raw_data.csv", run_eda=True, run_model=True, run_report=True)
```

---

## ☁️ Uploading to HuggingFace / PyPI

### Publishing to PyPI
To share your package with the world so they can `pip install insightflow`:
```bash
# 1. Install build tools
pip install build twine

# 2. Build your package
python -m build

# 3. Upload to PyPI
twine upload dist/*
```

### Hosting Privately on HuggingFace Spaces
You can host this entire workflow on HuggingFace Spaces or as a private HF Model repository:
1. Create a **Private Space** on HuggingFace.
2. Add your token to the **Space Secrets** as `HF_TOKEN`.
3. Push this exact codebase using standard `git`:
```bash
git remote add origin https://huggingface.co/spaces/YourUser/InsightFlow
git push origin main
```
