datadoc-cli 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/.gitignore +4 -0
  2. datadoc_cli-0.2.0/FULL_DOCUMENTATION.md +144 -0
  3. datadoc_cli-0.2.0/PKG-INFO +206 -0
  4. datadoc_cli-0.2.0/README.md +172 -0
  5. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/cli/app.py +300 -20
  6. datadoc_cli-0.2.0/datadoc/core/engine.py +271 -0
  7. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/plugins/base.py +4 -0
  8. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/pyproject.toml +4 -1
  9. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/tests/test_core.py +20 -0
  10. datadoc_cli-0.1.0/PKG-INFO +0 -254
  11. datadoc_cli-0.1.0/README.md +0 -223
  12. datadoc_cli-0.1.0/datadoc/core/engine.py +0 -142
  13. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/.github/workflows/ci.yml +0 -0
  14. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/CONTRIBUTING.md +0 -0
  15. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/LICENSE +0 -0
  16. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/__init__.py +0 -0
  17. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/cli/__init__.py +0 -0
  18. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/core/__init__.py +0 -0
  19. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/plugins/__init__.py +0 -0
  20. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/plugins/datetime_feat.py +0 -0
  21. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/plugins/encoders.py +0 -0
  22. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/plugins/missing_values.py +0 -0
  23. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/plugins/outliers.py +0 -0
  24. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/datadoc/plugins/scaling.py +0 -0
  25. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/test.csv +0 -0
  26. {datadoc_cli-0.1.0 → datadoc_cli-0.2.0}/tests/__init__.py +0 -0
@@ -31,3 +31,7 @@ report_*.md
31
31
  .pytest_cache/
32
32
  htmlcov/
33
33
  .coverage
34
+
35
+ # Environment & Secrets
36
+ .env
37
+ .env.*
@@ -0,0 +1,144 @@
1
+ # DATADOC: The Open Source OS for Dataset Engineering
2
+
3
+ ## Overview
4
+ **DATADOC** is a blazingly fast, deterministic, and highly extensible framework designed to automate the most tedious part of Machine Learning: Data Preparation. Built on top of **Polars**, it eliminates the 80% of time Data Scientists spend manually writing Pandas scripts to clean missing values, handle outliers, encode variables, and scale features.
5
+
6
+ DATADOC operates in two modes:
7
+ 1. **Rule-Based Engine:** A deterministic engine that automatically detects dataset flaws and applies best-practice transformations sequentially.
8
+ 2. **AI Planner Engine (Phase 2):** A semantic engine powered by **LiteLLM** that accepts natural language goals (e.g., "Clean this for a time-series forecast") and dynamically orchestrates the perfect pipeline—without ever sending your private, raw data rows to an external API.
9
+
10
+ ---
11
+
12
+ ## Key Features
13
+ * **Blazing Fast Backend:** Powered by Polars, processing millions of rows in milliseconds using multi-threaded Rust execution.
14
+ * **Intelligent Plugins:** Modular transformations (Missing Values, Outliers, Encoders, Scalers, Datetimes) that automatically trigger only when needed.
15
+ * **Terminal Dashboard:** A massive, rich CLI UI providing health reports, before/after diffs, and visual histograms right in your terminal.
16
+ * **Zero-Lock-in Export:** Hate black boxes? DATADOC can export the exact pipeline it generated into a standalone, highly-readable Python script.
17
+ * **Privacy-First AI:** Our AI Planner only extracts a high-level statistical metadata schema (column names, types, null counts) to prompt the LLM, keeping your actual rows secure on your local machine.
18
+ * **Bring Your Own Model:** Because we use LiteLLM, you can use any API key: Gemini, OpenAI, Claude, or local Ollama models.
19
+
20
+ ---
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ pip install datadoc-cli
26
+ ```
27
+ *(Requires Python 3.9+)*
28
+
29
+ ---
30
+
31
+ ## The CLI Reference
32
+
33
+ DATADOC ships with a beautiful, Typer-based CLI.
34
+
35
+ ### 1. `datadoc analyze <file.csv>`
36
+ Scans your dataset and prints a comprehensive "Health Report", checking for nulls, categorical imbalances, skewed numericals, and more.
37
+
38
+ ### 2. `datadoc recommend <file.csv>`
39
+ Does not touch your data. Instead, it outputs a numbered list of suggested actions it believes should be applied based on the health scan.
40
+
41
+ ### 3. `datadoc engineer <file.csv>`
42
+ The core command. It runs the dataset through the engine, applying transformations and outputs a `clean_file.csv`.
43
+ * **The AI Flag:** `datadoc engineer <file.csv> --ai --goal "Predict churn" --model "gemini/gemini-1.5-flash"`
44
+ * Activates the AI Planner to dynamically select plugins instead of the default rule sequence.
45
+
46
+ ### 4. `datadoc compare <file.csv>`
47
+ Runs the engineering pipeline in memory and prints a git-style diff comparing the "Before" vs "After" state (rows changed, columns added, missing values resolved).
48
+
49
+ ### 5. `datadoc visualize <file.csv>`
50
+ Generates a massive, interactive terminal dashboard containing ASCII bar charts and histograms comparing the numerical distributions before and after cleaning.
51
+
52
+ ### 6. `datadoc pipeline <file.csv>`
53
+ Exports the generated pipeline as a standalone `.py` script so you can deploy it to production, Airflow, or dbt without taking DATADOC as a dependency.
54
+
55
+ ### 7. `datadoc plugin`
56
+ Lists all registered plugins, their current version, priority order, and explanations of how they work.
57
+
58
+ ---
59
+
60
+ ## Python SDK Reference
61
+
62
+ You can use DATADOC programmatically inside your Jupyter Notebooks or Python backends.
63
+
64
+ ```python
65
+ import polars as pl
66
+ from datadoc.core.engine import DATADOC
67
+
68
+ # 1. Load the dataset
69
+ doc = DATADOC("data.csv")
70
+
71
+ # 2. Get the health report
72
+ report = doc.analyze()
73
+ print(report["rows"], report["cols"])
74
+
75
+ # 3. Engineer the data (Rule-Based)
76
+ clean_df = doc.engineer()
77
+
78
+ # 4. Engineer the data (AI Planner)
79
+ # Requires python-dotenv and a .env file with your API Key (e.g. GEMINI_API_KEY)
80
+ clean_df_ai = doc.ai_engineer(
81
+ model="gemini/gemini-1.5-flash",
82
+ goal="Prepare this data for XGBoost Classification"
83
+ )
84
+
85
+ # 5. Export Python Script
86
+ script = doc.pipeline()
87
+ with open("my_pipeline.py", "w") as f:
88
+ f.write(script)
89
+ ```
90
+
91
+ ---
92
+
93
+ ## The Plugin Architecture
94
+
95
+ DATADOC is built heavily on the **Strategy Pattern**. The core engine does almost nothing on its own; it simply orchestrates a list of `BasePlugin` objects.
96
+
97
+ ### Current Built-in Plugins
98
+ 1. **MissingValuePlugin:** Fills numeric nulls with the median and categorical nulls with the mode.
99
+ 2. **OutlierPlugin:** Uses the Interquartile Range (IQR) method to cap extreme values at the 5th and 95th percentiles.
100
+ 3. **DatetimePlugin:** Automatically detects string dates, converts them to Polars Datetime objects, and extracts features like `year`, `month`, and `day`.
101
+ 4. **CategoricalEncoderPlugin:** Automatically detects low-cardinality string columns and performs one-hot encoding (dummy variables).
102
+ 5. **ScalingPlugin:** Uses Min-Max scaling on numeric columns if their maximum values vary by more than 100x, ensuring algorithms like SVMs and Neural Networks converge quickly.
103
+
104
+ ### Writing a Custom Plugin
105
+ Creating a new rule is as simple as inheriting from `BasePlugin`.
106
+
107
+ ```python
108
+ import polars as pl
109
+ from datadoc.plugins.base import BasePlugin
110
+
111
+ class MyCustomPlugin(BasePlugin):
112
+ name = "MyCustomPlugin"
113
+ priority = 10
114
+
115
+ def analyze(self, df: pl.DataFrame) -> dict:
116
+ # Return a dictionary of findings.
117
+ # If any key starts with 'has_', the engine will trigger this plugin.
118
+ return {"has_work": True}
119
+
120
+ def recommend(self, analysis: dict) -> list[str]:
121
+ return ["I will apply custom logic to this dataframe."]
122
+
123
+ def apply(self, df: pl.DataFrame) -> pl.DataFrame:
124
+ # Return the transformed dataframe
125
+ return df.with_columns(pl.col("A") * 2)
126
+ ```
127
+
128
+ Once defined, simply append it to `doc.plugins` inside `engine.py`.
129
+
130
+ ---
131
+
132
+ ## Privacy & The AI Planner
133
+ Security is a massive concern in enterprise data. When you run `datadoc engineer --ai`, the LLM prompt looks like this:
134
+
135
+ ```json
136
+ {
137
+ "rows": 100000,
138
+ "columns": 5,
139
+ "schema": {"age": "Int64", "name": "String"},
140
+ "null_counts": {"age": 40},
141
+ "available_plugins": ["MissingValuePlugin", "ScalingPlugin"]
142
+ }
143
+ ```
144
+ **No PII or actual rows are sent over the wire.** The LLM simply replies with a strict JSON array instructing DATADOC on which local plugins to execute to achieve the user's goal.
@@ -0,0 +1,206 @@
1
+ Metadata-Version: 2.4
2
+ Name: datadoc-cli
3
+ Version: 0.2.0
4
+ Summary: The Open Source Operating System for Dataset Engineering.
5
+ Project-URL: Homepage, https://github.com/narain-karti/DATADOC
6
+ Project-URL: Repository, https://github.com/narain-karti/DATADOC
7
+ Project-URL: Issues, https://github.com/narain-karti/DATADOC/issues
8
+ Author: narain-karti
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Requires-Python: >=3.9
22
+ Requires-Dist: litellm>=1.40.0
23
+ Requires-Dist: numpy>=1.24.0
24
+ Requires-Dist: plotext>=5.2.8
25
+ Requires-Dist: polars>=0.20.0
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: python-dotenv>=1.0.0
28
+ Requires-Dist: rich>=13.7.0
29
+ Requires-Dist: typer>=0.12.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
32
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
33
+ Description-Content-Type: text/markdown
34
+
35
+ <p align="center">
36
+ <pre>
37
+ ____ _ _____ _ ____ ___ ____
38
+ | _ \ / \|_ _|/ \ | _ \ / _ \ / ___|
39
+ | | | |/ _ \ | | / _ \ | | | | | | | |
40
+ | |_| / ___ \| |/ ___ \| |_| | |_| | |___
41
+ |____/_/ \_\_/_/ \_\____/ \___/ \____|
42
+ </pre>
43
+ </p>
44
+
45
+ <h3 align="center">The Open Source Operating System for Dataset Engineering.</h3>
46
+
47
+ <p align="center">
48
+ <a href="https://pypi.org/project/datadoc-cli/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/datadoc-cli.svg"></a>
49
+ <a href="https://pypi.org/project/datadoc-cli/"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/datadoc-cli.svg"></a>
50
+ <a href="https://github.com/narain-karti/DATADOC/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
51
+ </p>
52
+
53
+ <p align="center">
54
+ <a href="#installation">Install</a> |
55
+ <a href="#why-datadoc">Why DATADOC?</a> |
56
+ <a href="#quick-start">Quick Start</a> |
57
+ <a href="#cli-commands">CLI Commands</a> |
58
+ <a href="#architecture--plugins">Architecture</a>
59
+ </p>
60
+
61
+ ---
62
+
63
+ ## 🚀 What is DATADOC?
64
+
65
+ **DATADOC** is an intelligent, blazing-fast Command Line Interface (CLI) and Python Library designed to completely automate the most tedious part of Machine Learning: **Dataset Engineering and Data Cleaning**.
66
+
67
+ Powered by a high-performance **Polars** backend, DATADOC analyzes your raw CSV files, diagnoses missing values, outliers, and schema issues, and **automatically engineers a machine-learning-ready dataset in milliseconds**.
68
+
69
+ **DATADOC is NOT just another EDA (Exploratory Data Analysis) tool.** It doesn't just show you charts. It **fixes your data** and hands you a portable, deterministic Python script to replicate the pipeline anywhere.
70
+
71
+ ### ⚡ The Impact: Why Industry Professionals Use DATADOC
72
+
73
+ Data Scientists and ML Engineers spend **80% of their time cleaning data** and only 20% training models.
74
+ DATADOC eliminates the 80%.
75
+
76
+ - **Save Hundreds of Hours:** Stop writing boilerplate code to impute nulls, one-hot encode categorical variables, or clip outliers. DATADOC does it in one command.
77
+ - **Zero Black-Box AI:** Every transformation is strictly mathematical (IQR, medians, mode). It is 100% deterministic, explainable, and safe for enterprise production environments.
78
+ - **Lightning Fast:** By utilizing `polars` (written in Rust) instead of `pandas`, DATADOC processes millions of rows with minimal memory overhead.
79
+ - **Agentic AI Integration:** DATADOC features a built-in AI Planner and an interactive Chat Assistant that can autonomously analyze your dataset, generate engineering plans, and execute plugins using tool-calling!
80
+ - **Avoid Data Leakage:** Built-in safeguards ensure that data scaling and imputation are handled correctly.
81
+
82
+ ---
83
+
84
+ ## 📦 Installation
85
+
86
+ DATADOC is published on PyPI. You can install it globally via `pip` or `uv`:
87
+
88
+ ```bash
89
+ pip install datadoc-cli
90
+ ```
91
+
92
+ *(Requires Python 3.9+)*
93
+
94
+ ---
95
+
96
+ ## 🛠️ Quick Start (CLI)
97
+
98
+ You don't need to write a single line of Python to clean your data. Just use the CLI.
99
+
100
+ ```bash
101
+ # 1. Analyze your dataset's health (shows a beautiful terminal report)
102
+ datadoc analyze raw_data.csv
103
+
104
+ # 2. Get recommendations (DATADOC tells you exactly what is wrong)
105
+ datadoc recommend raw_data.csv
106
+
107
+ # 3. AUTO-ENGINEER! (Fixes everything and saves clean_raw_data.csv)
108
+ datadoc engineer raw_data.csv
109
+
110
+ # 4. Compare the before vs. after visually in your terminal
111
+ datadoc compare raw_data.csv clean_raw_data.csv
112
+
113
+ # 5. Export a standalone Python script to automate this in the future
114
+ datadoc pipeline raw_data.csv
115
+
116
+ # 6. Have an interactive AI session where the LLM engineers your data via chat!
117
+ datadoc chat raw_data.csv
118
+
119
+ *(Pro Tip: Add `--ai` to `analyze`, `recommend`, or `engineer` for AI-driven insights and orchestration!)*
120
+ ```
121
+
122
+ ---
123
+
124
+ ## 🐍 Python SDK (Library Usage)
125
+
126
+ DATADOC is also a powerful Python library. You can import the engine directly into your Jupyter Notebooks or backend servers:
127
+
128
+ ```python
129
+ from datadoc.core.engine import DATADOC
130
+
131
+ # Initialize the blazing-fast Polars engine
132
+ doc = DATADOC("raw_data.csv")
133
+
134
+ # Generate a diagnostic report
135
+ report = doc.analyze()
136
+ print(report)
137
+
138
+ # Automatically engineer the dataset
139
+ clean_df = doc.engineer()
140
+ clean_df.write_csv("clean_data.csv")
141
+
142
+ # Export the generated pipeline script
143
+ with open("my_pipeline.py", "w") as f:
144
+ f.write(doc.pipeline())
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 💻 CLI Commands Reference
150
+
151
+ | Command | Description |
152
+ |---------|-------------|
153
+ | `datadoc analyze <file>` | Scans dataset and shows a health report with status indicators |
154
+ | `datadoc recommend <file>` | Lists suggested engineering steps without modifying data |
155
+ | `datadoc engineer <file>` | Automatically applies all recommended transformations |
156
+ | `datadoc chat <file>` | Starts an interactive AI session with autonomous tool-calling |
157
+ | `datadoc compare <file>` | Shows a before/after diff of the raw vs engineered dataset |
158
+ | `datadoc pipeline <file>` | Exports a standalone `.py` script with the exact Polars code |
159
+ | `datadoc visualize <file>` | Renders stunning terminal-based charts for numeric distributions |
160
+ | `datadoc plugin` | Lists all registered plugins with priority and descriptions |
161
+ | `datadoc version` | Displays the DATADOC version |
162
+
163
+ *(Note: Use the `--ai` flag on `analyze`, `recommend`, or `engineer` for LLM-powered execution!)*
164
+
165
+ ---
166
+
167
+ ## 🧩 Architecture & Plugins
168
+
169
+ DATADOC operates as an orchestrator. It passes your dataset through an isolated chain of plugins in a strict priority order.
170
+
171
+ | Priority | Plugin | Action Performed |
172
+ |----------|--------|-------------|
173
+ | 10 | **MissingValuePlugin** | Imputes missing numeric values with median, categorical with mode |
174
+ | 20 | **OutlierPlugin** | Detects outliers via IQR and clips them dynamically |
175
+ | 30 | **DatetimePlugin** | Detects date strings and extracts year, month, day, day_of_week |
176
+ | 40 | **CategoricalEncoderPlugin** | One-Hot Encodes categorical columns (< 10 unique values) |
177
+ | 45 | **ScalingPlugin** | Standard scales numeric columns when scale ratio exceeds 10x |
178
+
179
+ Every plugin implements a strict `BasePlugin` interface ensuring it can `analyze()`, `apply()`, `rollback()`, and `generate_code()`.
180
+
181
+ Want to build your own? See [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to create and register custom plugins!
182
+
183
+ ---
184
+
185
+ ## 🗺️ Roadmap
186
+
187
+ - [x] Core Engine with plugin orchestration
188
+ - [x] 5 Built-in deterministic plugins
189
+ - [x] Stunning Rich Terminal UI
190
+ - [x] Pipeline export capability
191
+ - [x] **Polars Backend Migration (100x Performance Boost)**
192
+ - [x] PyPI Release (`pip install datadoc-cli`)
193
+ - [x] Phase 2: Agentic AI Planner (LLM Orchestration)
194
+ - [x] Interactive AI Chat with Tool-Calling capabilities
195
+ - [ ] Export targets for `dbt` and Apache Airflow
196
+ - [ ] REST API (FastAPI) wrapper
197
+
198
+ ---
199
+
200
+ ## ⚖️ License
201
+
202
+ This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
203
+
204
+ ## 🤝 Contributing
205
+
206
+ We welcome contributions from the community! If you'd like to add a new plugin or improve the core engine, please see [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,172 @@
1
+ <p align="center">
2
+ <pre>
3
+ ____ _ _____ _ ____ ___ ____
4
+ | _ \ / \|_ _|/ \ | _ \ / _ \ / ___|
5
+ | | | |/ _ \ | | / _ \ | | | | | | | |
6
+ | |_| / ___ \| |/ ___ \| |_| | |_| | |___
7
+ |____/_/ \_\_/_/ \_\____/ \___/ \____|
8
+ </pre>
9
+ </p>
10
+
11
+ <h3 align="center">The Open Source Operating System for Dataset Engineering.</h3>
12
+
13
+ <p align="center">
14
+ <a href="https://pypi.org/project/datadoc-cli/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/datadoc-cli.svg"></a>
15
+ <a href="https://pypi.org/project/datadoc-cli/"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/datadoc-cli.svg"></a>
16
+ <a href="https://github.com/narain-karti/DATADOC/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="#installation">Install</a> |
21
+ <a href="#why-datadoc">Why DATADOC?</a> |
22
+ <a href="#quick-start">Quick Start</a> |
23
+ <a href="#cli-commands">CLI Commands</a> |
24
+ <a href="#architecture--plugins">Architecture</a>
25
+ </p>
26
+
27
+ ---
28
+
29
+ ## 🚀 What is DATADOC?
30
+
31
+ **DATADOC** is an intelligent, blazing-fast Command Line Interface (CLI) and Python Library designed to completely automate the most tedious part of Machine Learning: **Dataset Engineering and Data Cleaning**.
32
+
33
+ Powered by a high-performance **Polars** backend, DATADOC analyzes your raw CSV files, diagnoses missing values, outliers, and schema issues, and **automatically engineers a machine-learning-ready dataset in milliseconds**.
34
+
35
+ **DATADOC is NOT just another EDA (Exploratory Data Analysis) tool.** It doesn't just show you charts. It **fixes your data** and hands you a portable, deterministic Python script to replicate the pipeline anywhere.
36
+
37
+ ### ⚡ The Impact: Why Industry Professionals Use DATADOC
38
+
39
+ Data Scientists and ML Engineers spend **80% of their time cleaning data** and only 20% training models.
40
+ DATADOC eliminates the 80%.
41
+
42
+ - **Save Hundreds of Hours:** Stop writing boilerplate code to impute nulls, one-hot encode categorical variables, or clip outliers. DATADOC does it in one command.
43
+ - **Zero Black-Box AI:** Every transformation is strictly mathematical (IQR, medians, mode). It is 100% deterministic, explainable, and safe for enterprise production environments.
44
+ - **Lightning Fast:** By utilizing `polars` (written in Rust) instead of `pandas`, DATADOC processes millions of rows with minimal memory overhead.
45
+ - **Agentic AI Integration:** DATADOC features a built-in AI Planner and an interactive Chat Assistant that can autonomously analyze your dataset, generate engineering plans, and execute plugins using tool-calling!
46
+ - **Avoid Data Leakage:** Built-in safeguards ensure that data scaling and imputation are handled correctly.
47
+
48
+ ---
49
+
50
+ ## 📦 Installation
51
+
52
+ DATADOC is published on PyPI. You can install it globally via `pip` or `uv`:
53
+
54
+ ```bash
55
+ pip install datadoc-cli
56
+ ```
57
+
58
+ *(Requires Python 3.9+)*
59
+
60
+ ---
61
+
62
+ ## 🛠️ Quick Start (CLI)
63
+
64
+ You don't need to write a single line of Python to clean your data. Just use the CLI.
65
+
66
+ ```bash
67
+ # 1. Analyze your dataset's health (shows a beautiful terminal report)
68
+ datadoc analyze raw_data.csv
69
+
70
+ # 2. Get recommendations (DATADOC tells you exactly what is wrong)
71
+ datadoc recommend raw_data.csv
72
+
73
+ # 3. AUTO-ENGINEER! (Fixes everything and saves clean_raw_data.csv)
74
+ datadoc engineer raw_data.csv
75
+
76
+ # 4. Compare the before vs. after visually in your terminal
77
+ datadoc compare raw_data.csv clean_raw_data.csv
78
+
79
+ # 5. Export a standalone Python script to automate this in the future
80
+ datadoc pipeline raw_data.csv
81
+
82
+ # 6. Have an interactive AI session where the LLM engineers your data via chat!
83
+ datadoc chat raw_data.csv
84
+
85
+ *(Pro Tip: Add `--ai` to `analyze`, `recommend`, or `engineer` for AI-driven insights and orchestration!)*
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 🐍 Python SDK (Library Usage)
91
+
92
+ DATADOC is also a powerful Python library. You can import the engine directly into your Jupyter Notebooks or backend servers:
93
+
94
+ ```python
95
+ from datadoc.core.engine import DATADOC
96
+
97
+ # Initialize the blazing-fast Polars engine
98
+ doc = DATADOC("raw_data.csv")
99
+
100
+ # Generate a diagnostic report
101
+ report = doc.analyze()
102
+ print(report)
103
+
104
+ # Automatically engineer the dataset
105
+ clean_df = doc.engineer()
106
+ clean_df.write_csv("clean_data.csv")
107
+
108
+ # Export the generated pipeline script
109
+ with open("my_pipeline.py", "w") as f:
110
+ f.write(doc.pipeline())
111
+ ```
112
+
113
+ ---
114
+
115
+ ## 💻 CLI Commands Reference
116
+
117
+ | Command | Description |
118
+ |---------|-------------|
119
+ | `datadoc analyze <file>` | Scans dataset and shows a health report with status indicators |
120
+ | `datadoc recommend <file>` | Lists suggested engineering steps without modifying data |
121
+ | `datadoc engineer <file>` | Automatically applies all recommended transformations |
122
+ | `datadoc chat <file>` | Starts an interactive AI session with autonomous tool-calling |
123
+ | `datadoc compare <file>` | Shows a before/after diff of the raw vs engineered dataset |
124
+ | `datadoc pipeline <file>` | Exports a standalone `.py` script with the exact Polars code |
125
+ | `datadoc visualize <file>` | Renders stunning terminal-based charts for numeric distributions |
126
+ | `datadoc plugin` | Lists all registered plugins with priority and descriptions |
127
+ | `datadoc version` | Displays the DATADOC version |
128
+
129
+ *(Note: Use the `--ai` flag on `analyze`, `recommend`, or `engineer` for LLM-powered execution!)*
130
+
131
+ ---
132
+
133
+ ## 🧩 Architecture & Plugins
134
+
135
+ DATADOC operates as an orchestrator. It passes your dataset through an isolated chain of plugins in a strict priority order.
136
+
137
+ | Priority | Plugin | Action Performed |
138
+ |----------|--------|-------------|
139
+ | 10 | **MissingValuePlugin** | Imputes missing numeric values with median, categorical with mode |
140
+ | 20 | **OutlierPlugin** | Detects outliers via IQR and clips them dynamically |
141
+ | 30 | **DatetimePlugin** | Detects date strings and extracts year, month, day, day_of_week |
142
+ | 40 | **CategoricalEncoderPlugin** | One-Hot Encodes categorical columns (< 10 unique values) |
143
+ | 45 | **ScalingPlugin** | Standard scales numeric columns when scale ratio exceeds 10x |
144
+
145
+ Every plugin implements a strict `BasePlugin` interface ensuring it can `analyze()`, `apply()`, `rollback()`, and `generate_code()`.
146
+
147
+ Want to build your own? See [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to create and register custom plugins!
148
+
149
+ ---
150
+
151
+ ## 🗺️ Roadmap
152
+
153
+ - [x] Core Engine with plugin orchestration
154
+ - [x] 5 Built-in deterministic plugins
155
+ - [x] Stunning Rich Terminal UI
156
+ - [x] Pipeline export capability
157
+ - [x] **Polars Backend Migration (100x Performance Boost)**
158
+ - [x] PyPI Release (`pip install datadoc-cli`)
159
+ - [x] Phase 2: Agentic AI Planner (LLM Orchestration)
160
+ - [x] Interactive AI Chat with Tool-Calling capabilities
161
+ - [ ] Export targets for `dbt` and Apache Airflow
162
+ - [ ] REST API (FastAPI) wrapper
163
+
164
+ ---
165
+
166
+ ## ⚖️ License
167
+
168
+ This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
169
+
170
+ ## 🤝 Contributing
171
+
172
+ We welcome contributions from the community! If you'd like to add a new plugin or improve the core engine, please see [CONTRIBUTING.md](CONTRIBUTING.md).