Metadata-Version: 2.4
Name: nitrocsv-eda
Version: 0.1.2
Summary: A hardware-accelerated CSV EDA and heatmap generator.
Author-email: CodingMaster24 <sivatech24@gmail.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: seaborn
Requires-Dist: matplotlib
Requires-Dist: hwdetect
Dynamic: license-file

--

# NitroCSV-EDA 🚀

A high-performance, hardware-aware Exploratory Data Analysis (EDA) tool for CSV files. NitroCSV-EDA automates data classification, statistical descriptions, and correlation heatmap generation.

It leverages a hybrid architecture: using Python for data orchestration and visualization, while offloading heavy matrix math to a dynamically compiled **CUDA C++** backend if an NVIDIA GPU is detected, or a **C** backend for CPU only systems.

## ✨ Key Features

* **Automated Dependency Management:** Automatically installs missing Python dependencies (`pandas`, `numpy`, `seaborn`, `matplotlib`, `hwdetect`) on the first run.
* **Smart Hardware Detection:** Uses `hwdetect` to scan the PCI bus for NVIDIA GPUs and seamlessly routes workloads.
* **Dynamic Backend Compilation:** Compiles high-performance C (`gcc`) or CUDA (`nvcc`) backend engines at runtime. No manual building required.
* **Automated EDA Pipeline:**
* Generates `head()` and `tail()` previews.
* Calculates descriptive statistics for all columns.
* Classifies data types (Numeric, Categorical, Temporal) and provides column-level explanations.


* **Headless & GUI Aware:** Automatically detects if you are running in a GUI/Jupyter environment or a headless Linux/WSL terminal. It displays an interactive heatmap window when possible, or gracefully falls back to a clean, DB-formatted ASCII matrix in the terminal.
* **Memory Optimized:** Employs aggressive garbage collection (`gc`) and binary `.dat` file streaming to keep RAM usage low during heavy matrix transpositions.
* **Secure Session Windup:** Visual outputs are cached in the system's `/tmp` directory and automatically purged the moment the session closes.

---

## 🛠️ Prerequisites

* **Python:** 3.7+
* **OS:** Linux or WSL (Windows Subsystem for Linux) recommended.
* **Compilers:**
* `gcc` (Required for the CPU backend compilation)
* `nvcc` / CUDA Toolkit (Optional, required only for GPU backend compilation)



---

## 📦 Installation

Since NitroCSV-EDA is packaged with a CLI entry point, you can install it directly via pip.

1. **Install the package:**
```bash
pip install nitrocsv-eda

```



---

## 🚀 Usage

Once installed, the `nitrocsv` command becomes available globally in your terminal. Pass the target CSV file as an argument:

```bash
nitrocsv path/to/your/dataset.csv

```

### Example Output Workflow

1. **Dependency Check:** Verifies and installs missing Python libraries.
2. **Analysis:** Prints data types, missing values, and column statistics.
3. **Execution:**
* Detects hardware (e.g., *NVIDIA GPU detected. Will utilize CUDA backend.*)
* Flattens the dataframe into a temporary binary file.
* Executes the optimized C or CUDA engine to compute the Pearson correlation matrix.


4. **Rendering:**
* **In Jupyter/Desktop:** Opens a high-res Seaborn heatmap window.
* **In WSL/Terminal:** Prints a structured, readable raw correlation matrix directly to the console.



---

## 🧠 Under the Hood (How it Works)

NitroCSV-EDA is built to bypass Python's Global Interpreter Lock (GIL) and memory bottlenecks during heavy EDA operations:

1. **Python Orchestrator:** Pandas is used solely for initial CSV ingestion, type checking, and printing standard data shapes.
2. **Binary Handoff:** Instead of using `.corr()` in Pandas, the numeric data is packed into raw bytes (`struct.pack`) and dumped to an `input_matrix.dat` file. The Pandas dataframe is immediately garbage-collected to free RAM.
3. **External Compute:** The Python script calls the compiled `./corr_gpu` or `./corr_cpu` binary via `subprocess`. The C/CUDA script loads the `.dat` file, processes the $O(n^2)$ correlation math at hardware speeds, and writes an `output_corr.dat` file.
4. **Visual Windup:** Python reads the output binary, generates a Seaborn heatmap, saves it to a temporary `.png`, and either displays it or prints the raw table. An `atexit` hook ensures no temporary files are left behind on your hard drive.
