cleanframe-engine 0.3.0__py3-none-any.whl
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.
- cleanframe/__init__.py +169 -0
- cleanframe/__main__.py +5 -0
- cleanframe/_util.py +438 -0
- cleanframe/_version.py +1 -0
- cleanframe/api.py +559 -0
- cleanframe/cli.py +688 -0
- cleanframe/codegen.py +666 -0
- cleanframe/dataio.py +506 -0
- cleanframe/detectors/__init__.py +43 -0
- cleanframe/detectors/base.py +221 -0
- cleanframe/detectors/categories.py +199 -0
- cleanframe/detectors/contacts.py +105 -0
- cleanframe/detectors/currency.py +112 -0
- cleanframe/detectors/dates.py +204 -0
- cleanframe/detectors/dedup.py +150 -0
- cleanframe/detectors/nulls.py +109 -0
- cleanframe/detectors/outliers.py +73 -0
- cleanframe/detectors/schema_mapping.py +125 -0
- cleanframe/detectors/text.py +105 -0
- cleanframe/detectors/units.py +86 -0
- cleanframe/diff.py +369 -0
- cleanframe/drift.py +283 -0
- cleanframe/errors.py +66 -0
- cleanframe/executor.py +229 -0
- cleanframe/fingerprint.py +83 -0
- cleanframe/issues.py +186 -0
- cleanframe/llm.py +811 -0
- cleanframe/ops.py +1245 -0
- cleanframe/planner.py +353 -0
- cleanframe/profile.py +413 -0
- cleanframe/py.typed +1 -0
- cleanframe/quality.py +81 -0
- cleanframe/readfix.py +160 -0
- cleanframe/recipe.py +398 -0
- cleanframe/report.py +345 -0
- cleanframe/result.py +144 -0
- cleanframe/schema.py +259 -0
- cleanframe/streaming.py +354 -0
- cleanframe/types.py +119 -0
- cleanframe/validate.py +363 -0
- cleanframe/workbook.py +370 -0
- cleanframe_engine-0.3.0.dist-info/METADATA +323 -0
- cleanframe_engine-0.3.0.dist-info/RECORD +46 -0
- cleanframe_engine-0.3.0.dist-info/WHEEL +4 -0
- cleanframe_engine-0.3.0.dist-info/entry_points.txt +2 -0
- cleanframe_engine-0.3.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cleanframe-engine
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: The reproducible data-cleaning engine for Python. AI writes the recipe once; the recipe runs forever — deterministic, diffable, reviewable.
|
|
5
|
+
Project-URL: Homepage, https://github.com/inboxpraveen/Cleanframe
|
|
6
|
+
Project-URL: Repository, https://github.com/inboxpraveen/Cleanframe
|
|
7
|
+
Project-URL: Documentation, https://github.com/inboxpraveen/Cleanframe/wiki
|
|
8
|
+
Project-URL: Issues, https://github.com/inboxpraveen/Cleanframe/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/inboxpraveen/Cleanframe/blob/main/CHANGELOG.md
|
|
10
|
+
Author: CleanFrame contributors
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: data-cleaning,data-quality,data-validation,etl,pandas,reproducible,schema-drift
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Requires-Dist: jinja2>=3.0
|
|
26
|
+
Requires-Dist: numpy>=1.23
|
|
27
|
+
Requires-Dist: pandas<4,>=1.5
|
|
28
|
+
Requires-Dist: python-dateutil>=2.8
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Provides-Extra: all
|
|
31
|
+
Requires-Dist: anthropic>=0.30; extra == 'all'
|
|
32
|
+
Requires-Dist: openai>=1.0; extra == 'all'
|
|
33
|
+
Requires-Dist: openpyxl>=3.0; extra == 'all'
|
|
34
|
+
Requires-Dist: pyarrow>=12.0; extra == 'all'
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: mypy>=1.8; extra == 'dev'
|
|
37
|
+
Requires-Dist: openpyxl>=3.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
41
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
42
|
+
Provides-Extra: excel
|
|
43
|
+
Requires-Dist: openpyxl>=3.0; extra == 'excel'
|
|
44
|
+
Provides-Extra: llm
|
|
45
|
+
Requires-Dist: anthropic>=0.30; extra == 'llm'
|
|
46
|
+
Requires-Dist: openai>=1.0; extra == 'llm'
|
|
47
|
+
Provides-Extra: parquet
|
|
48
|
+
Requires-Dist: pyarrow>=12.0; extra == 'parquet'
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
|
|
51
|
+
<p align="center">
|
|
52
|
+
<img src="https://raw.githubusercontent.com/inboxpraveen/Cleanframe/main/docs/assets/Logo.png" alt="CleanFrame logo" width="180" />
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
<h1 align="center">CleanFrame</h1>
|
|
56
|
+
|
|
57
|
+
<p align="center">
|
|
58
|
+
<b>The reproducible data-cleaning engine for Python.</b><br/>
|
|
59
|
+
AI writes the cleaning recipe once. The recipe runs forever — deterministic, diffable, reviewable.
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
<p align="center">
|
|
63
|
+
<img src="https://raw.githubusercontent.com/inboxpraveen/Cleanframe/main/docs/assets/Hero.png" width="auto" alt="CleanFrame"/>
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
<p align="center">
|
|
67
|
+
<a href="https://pypi.org/project/cleanframe-engine/"><img src="https://img.shields.io/pypi/v/cleanframe-engine" alt="PyPI"/></a>
|
|
68
|
+
<a href="https://github.com/inboxpraveen/Cleanframe/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License"/></a>
|
|
69
|
+
<a href="https://github.com/inboxpraveen/Cleanframe/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/inboxpraveen/Cleanframe/ci.yml?branch=main" alt="CI"/></a>
|
|
70
|
+
<img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python"/>
|
|
71
|
+
<img src="https://img.shields.io/badge/LLM-optional-success" alt="LLM optional"/>
|
|
72
|
+
<a href="https://github.com/inboxpraveen/Cleanframe/wiki"><img src="https://img.shields.io/badge/docs-wiki-informational" alt="Wiki"/></a>
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
Every team has that file. The vendor spreadsheet that arrives monthly with dates in three formats. The CRM export where `Bengaluru`, `Bangalore`, and `BLR` are three different cities. The finance sheet with `₹1,20,000` in a column typed as text.
|
|
78
|
+
|
|
79
|
+
You clean it by hand. Next month, it arrives broken in a new way, and you clean it again.
|
|
80
|
+
|
|
81
|
+
**CleanFrame ends that loop.** It profiles your data, detects issues, proposes a cleanup plan (with an LLM's help — or without one), executes it with pure pandas, and saves the whole thing as a **recipe**: a versionable YAML file that replays on every future file with **zero AI calls**, and alerts you when the incoming schema drifts.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
AI suggests. Pandas executes. Rules validate. You approve. Everything is reproducible.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Documentation
|
|
88
|
+
|
|
89
|
+
| | |
|
|
90
|
+
|--|--|
|
|
91
|
+
| **[Wiki (full docs)](https://github.com/inboxpraveen/Cleanframe/wiki)** | Getting started, API, recipe/schema specs, production guide |
|
|
92
|
+
| **[docs/](https://github.com/inboxpraveen/Cleanframe/tree/main/docs)** | Same guides in-repo |
|
|
93
|
+
| **[CONTRIBUTING.md](https://github.com/inboxpraveen/Cleanframe/blob/main/CONTRIBUTING.md)** | Invariants + how to add detectors/ops |
|
|
94
|
+
| **[SECURITY.md](https://github.com/inboxpraveen/Cleanframe/blob/main/SECURITY.md)** | Vulnerability reporting |
|
|
95
|
+
| **[CHANGELOG.md](https://github.com/inboxpraveen/Cleanframe/blob/main/CHANGELOG.md)** | Release notes |
|
|
96
|
+
|
|
97
|
+
## Why not just use an LLM agent on my dataframe?
|
|
98
|
+
|
|
99
|
+
Because you can't ship "the model probably fixed it" to production. Chat-with-your-data tools are great for exploration and say so themselves — they are not built for pipelines. CleanFrame is built on one rule:
|
|
100
|
+
|
|
101
|
+
> **The LLM never touches your data. It only writes the plan.**
|
|
102
|
+
|
|
103
|
+
The plan compiles to deterministic pandas operations. Same input → same output, every time. Every changed cell is tracked. Every step is reviewable, reversible, and exportable as plain Python you can read.
|
|
104
|
+
|
|
105
|
+
## 30-second demo
|
|
106
|
+
|
|
107
|
+
No API key needed for this:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install cleanframe-engine
|
|
111
|
+
cleanframe report examples/messy_customers.csv
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
You get an HTML report: detected issues, quality score, column-by-column diagnosis. Then fix it:
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
import pandas as pd
|
|
118
|
+
import cleanframe as cf
|
|
119
|
+
|
|
120
|
+
df = pd.read_csv("examples/messy_customers.csv")
|
|
121
|
+
|
|
122
|
+
result = cf.clean(
|
|
123
|
+
df,
|
|
124
|
+
target_schema="examples/customer.schema.yaml", # or: cf.infer_schema(df)
|
|
125
|
+
llm="anthropic/claude-sonnet-4-6", # optional — omit for rules-only
|
|
126
|
+
mode="review", # review | auto | strict
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
result.diff.show() # cell-level before/after, git-diff style
|
|
130
|
+
result.recipe.save("customer.recipe.yaml") # ← the durable artifact
|
|
131
|
+
result.code.save("clean_customers.py") # plain pandas, no cleanframe dependency
|
|
132
|
+
clean_df = result.dataframe
|
|
133
|
+
result.quarantine # rows validation held back, with reasons — never deleted
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The sample file has one genuinely invalid email, so the demo quarantines that row and
|
|
137
|
+
cleans the other five.
|
|
138
|
+
|
|
139
|
+
Next month, the file comes back. No LLM, no tokens, no variance:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
cleanframe apply new_customers.csv --recipe customer.recipe.yaml --out clean.csv
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
If the new file's schema drifted (a renamed column, a new currency format), CleanFrame **stops and tells you** instead of silently corrupting data:
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
⚠ Schema drift detected in new_customers.csv
|
|
149
|
+
• Column "Amt (INR)" is new — 94% match to recipe column "amount_inr"
|
|
150
|
+
• 312 values in "signup_date" match no allowed date format (new: "Jan 5, 26")
|
|
151
|
+
Run `cleanframe suggest new_customers.csv --recipe customer.recipe.yaml --update` to review a patch.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Bring your own API key (or no key at all)
|
|
155
|
+
|
|
156
|
+
CleanFrame is LLM-optional and provider-agnostic.
|
|
157
|
+
|
|
158
|
+
| Mode | What runs | Data leaves your machine? |
|
|
159
|
+
|---|---|---|
|
|
160
|
+
| **Rules-only** (default) | Deterministic detectors + heuristics | Never |
|
|
161
|
+
| **Metadata** | LLM sees column names, dtypes, and *value patterns* (regex sketches) — never raw values | Only metadata |
|
|
162
|
+
| **Sample** | LLM sees an anonymized, shuffled sample you approve | Only the approved sample |
|
|
163
|
+
| **Replay** | Saved recipes | Never — recipes need no LLM |
|
|
164
|
+
|
|
165
|
+
- Keys come from environment variables (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
|
|
166
|
+
`OPENROUTER_API_KEY`, `GROQ_API_KEY`, …). CleanFrame never stores, logs, or
|
|
167
|
+
transmits them.
|
|
168
|
+
- Any provider that speaks OpenAI Chat Completions works out of the box —
|
|
169
|
+
Anthropic (native), OpenAI, OpenRouter, Groq, Together, Fireworks, DeepSeek,
|
|
170
|
+
Mistral, Google Gemini, xAI, Perplexity, Cohere, plus local Ollama / LM Studio
|
|
171
|
+
or any custom `OPENAI_BASE_URL`. Spec format: `provider/model`
|
|
172
|
+
(e.g. `openrouter/anthropic/claude-sonnet-4`, `groq/llama-3.3-70b-versatile`).
|
|
173
|
+
- Hard cost cap: `cf.clean(..., max_tokens_budget=50_000)` aborts planning before it gets expensive.
|
|
174
|
+
- Fully offline / air-gapped operation is a supported first-class mode, not a degraded one.
|
|
175
|
+
|
|
176
|
+
## What it cleans
|
|
177
|
+
|
|
178
|
+
| Problem | Example |
|
|
179
|
+
|---|---|
|
|
180
|
+
| Column name chaos | `Cust Name`, `customer_name`, `CustomerName` → `customer_name` |
|
|
181
|
+
| Date formats | `12/01/24`, `1 Jan 2024`, `2024-01-01` → ISO dates |
|
|
182
|
+
| Currency & numbers | `₹1,20,000`, `$1,200`, `1200 INR` → typed floats + currency column |
|
|
183
|
+
| Category variants | `Bengaluru` / `Bangalore` / `BLR` → one canonical value |
|
|
184
|
+
| Emails & phones | validation, normalization, country codes |
|
|
185
|
+
| Duplicates | exact + fuzzy matching with reviewable merge proposals |
|
|
186
|
+
| Missing values | detected and explained; strategies proposed, never silently applied |
|
|
187
|
+
| Units | `5kg`, `5000 g`, `5 KG` → normalized |
|
|
188
|
+
| Schema mapping | messy file → your target schema, with confidence scores |
|
|
189
|
+
| Outliers | flagged with evidence — **detected, never auto-"fixed"** |
|
|
190
|
+
|
|
191
|
+
## Production-ready defaults
|
|
192
|
+
|
|
193
|
+
CleanFrame is built for pipelines, not just demos:
|
|
194
|
+
|
|
195
|
+
- **Plan once, replay forever** — commit recipes; fail on schema drift
|
|
196
|
+
- **Multi-sheet workbooks** — clean every Excel tab into one reviewable recipe; write-back refuses to overwrite the source in place
|
|
197
|
+
- **Out-of-core streaming** — replay row-independent recipes over larger-than-RAM CSVs at chunk-bounded memory
|
|
198
|
+
- **Format auto-detection** — encoding (utf-8 → cp1252) and delimiter sniffed at read time, pinned into the recipe for replay
|
|
199
|
+
- **Bounded memory** — detector sampling (50k values) + capped cell-diff detail (100k); the diff snapshots only op-touched columns (peak ≈ input, not 2× the frame)
|
|
200
|
+
- **Safe CSV exports** — spreadsheet formula injection escaped by default
|
|
201
|
+
- **Regex guards** — oversized / nested-quantifier patterns rejected
|
|
202
|
+
- **Visible degradation** — missing columns, unparseable values and LLM fallbacks warn instead of failing silently
|
|
203
|
+
- **Quarantine, don't delete** — validation failures are held with reasons
|
|
204
|
+
- **Verbatim reads** — `text=True` keeps leading zeros, literal `NA` and `1e5` exactly as the file has them; otherwise CleanFrame warns about what pandas' type inference changed on read
|
|
205
|
+
- **Never overwrites its input** — writing output over the source file takes an explicit `--overwrite`, and every write lands via a temporary file
|
|
206
|
+
- **Scriptable exits** — distinct exit codes for usage errors, data errors, drift stops and validation failures
|
|
207
|
+
|
|
208
|
+
See the [Production Guide](https://github.com/inboxpraveen/Cleanframe/wiki/Production-Guide).
|
|
209
|
+
|
|
210
|
+
## The recipe: your durable artifact
|
|
211
|
+
|
|
212
|
+
```yaml
|
|
213
|
+
# customer.recipe.yaml — generated by CleanFrame, edited by you, owned by git
|
|
214
|
+
version: 1
|
|
215
|
+
# source_fingerprint: {...} ← stamped automatically; drives drift detection
|
|
216
|
+
columns:
|
|
217
|
+
"Customer Name":
|
|
218
|
+
rename_to: customer_name
|
|
219
|
+
ops: [strip_whitespace, title_case]
|
|
220
|
+
"Signup Date":
|
|
221
|
+
rename_to: signup_date
|
|
222
|
+
parse_date: {dayfirst: true, allowed: ["%d/%m/%Y", "%d-%m-%Y", "%Y-%m-%d"]}
|
|
223
|
+
"Amount":
|
|
224
|
+
rename_to: amount_inr
|
|
225
|
+
ops: [{remove_symbols: ["₹", ","]}, {cast: float}]
|
|
226
|
+
"City":
|
|
227
|
+
rename_to: city
|
|
228
|
+
normalize_values: {Bengaluru: Bangalore, BLR: Bangalore, Bombay: Mumbai}
|
|
229
|
+
"Email":
|
|
230
|
+
rename_to: email
|
|
231
|
+
ops: [strip_whitespace, normalize_email]
|
|
232
|
+
validate:
|
|
233
|
+
- {column: email, check: valid_email, on_fail: quarantine}
|
|
234
|
+
- {column: amount_inr, check: ">= 0", on_fail: quarantine}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
A worked example ships in [`examples/`](https://github.com/inboxpraveen/Cleanframe/tree/main/examples) (`messy_customers.csv`,
|
|
238
|
+
`customer.schema.yaml`, `customer.recipe.yaml`).
|
|
239
|
+
|
|
240
|
+
Recipes are reviewed in PRs like code, replayed in CI/Airflow/dbt, and exported as
|
|
241
|
+
plain pandas via `result.code` — CleanFrame plays *with* your validation stack,
|
|
242
|
+
not against it.
|
|
243
|
+
|
|
244
|
+
## How it compares
|
|
245
|
+
|
|
246
|
+
| | CleanFrame | PandasAI | Great Expectations / pandera | YData Profiling | OpenRefine | Flatfile / OneSchema |
|
|
247
|
+
|---|---|---|---|---|---|---|
|
|
248
|
+
| Fixes data (not just reports) | ✅ | ⚠️ ad-hoc | ❌ validates only | ❌ profiles only | ✅ | ✅ |
|
|
249
|
+
| Deterministic & reproducible | ✅ recipes | ❌ | ✅ | ✅ | ⚠️ manual | ⚠️ |
|
|
250
|
+
| Production pipelines | ✅ | ❌ (exploration tool) | ✅ | ⚠️ | ❌ GUI | ✅ |
|
|
251
|
+
| Python-native library + CLI | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ JS widget / SaaS |
|
|
252
|
+
| Works with zero LLM / offline | ✅ | ❌ | ✅ | ✅ | ✅ | ⚠️ |
|
|
253
|
+
| Cell-level diff & lineage | ✅ | ❌ | ❌ | ❌ | ⚠️ | ⚠️ |
|
|
254
|
+
| Schema-drift alerts on re-import | ✅ | ❌ | ⚠️ | ❌ | ❌ | ✅ ($6k+/yr) |
|
|
255
|
+
| Free & open source | ✅ Apache-2.0 | ✅ | ✅ | ✅ | ✅ | ❌ |
|
|
256
|
+
|
|
257
|
+
Use PandasAI to *explore*. Use pandera/GX to *guard*. Use **CleanFrame to fix — repeatably.**
|
|
258
|
+
|
|
259
|
+
## Architecture
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
CSV / Excel / DataFrame
|
|
263
|
+
│
|
|
264
|
+
▼
|
|
265
|
+
Profiler ─→ Issue Detectors ─→ Planner ──────────→ Recipe (YAML)
|
|
266
|
+
(deterministic) (rules, or │
|
|
267
|
+
LLM-assisted) ▼
|
|
268
|
+
Executor (pure pandas)
|
|
269
|
+
│
|
|
270
|
+
▼
|
|
271
|
+
Validator · Cell-diff · HTML report
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Detectors are plugins — write your own in ~30 lines:
|
|
275
|
+
|
|
276
|
+
```python
|
|
277
|
+
@cf.detector("iban")
|
|
278
|
+
def detect_iban(series: pd.Series) -> cf.Issues: ...
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Install
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
pip install cleanframe-engine
|
|
285
|
+
pip install "cleanframe-engine[excel]" # Excel
|
|
286
|
+
pip install "cleanframe-engine[parquet]" # Parquet
|
|
287
|
+
pip install "cleanframe-engine[llm]" # Anthropic + OpenAI SDKs
|
|
288
|
+
pip install "cleanframe-engine[all]"
|
|
289
|
+
|
|
290
|
+
# straight from git
|
|
291
|
+
pip install "cleanframe-engine @ git+https://github.com/inboxpraveen/Cleanframe"
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Python 3.10+. The distribution is `cleanframe-engine`; the import package is
|
|
295
|
+
`cleanframe` (`import cleanframe as cf`), and the CLI is `cleanframe` (or
|
|
296
|
+
`python -m cleanframe`).
|
|
297
|
+
|
|
298
|
+
## Roadmap
|
|
299
|
+
|
|
300
|
+
- [x] Profiler, core detectors (dates, currency, categories, dedup, nulls, schema mapping)
|
|
301
|
+
- [x] Recipe format v1 + replay + drift detection
|
|
302
|
+
- [x] HTML reports, cell-level diff
|
|
303
|
+
- [x] Production safety guards (sampling, CSV sanitisation, regex limits, diff caps)
|
|
304
|
+
- [x] Multi-sheet Excel workbooks (clean every tab, safe write-back)
|
|
305
|
+
- [x] Selective ingestion (sheet / columns / rows)
|
|
306
|
+
- [x] Out-of-core streaming replay (larger-than-RAM CSVs)
|
|
307
|
+
- [x] Read-time format auto-correction (encoding + delimiter)
|
|
308
|
+
- [ ] `MessyData-100` public benchmark + leaderboard
|
|
309
|
+
- [ ] pandera / GX / dbt exporters
|
|
310
|
+
- [ ] Polars backend
|
|
311
|
+
- [ ] Recipe registry for teams
|
|
312
|
+
|
|
313
|
+
## Contributing
|
|
314
|
+
|
|
315
|
+
The detector plugin system exists so the community owns the long tail of messy-data weirdness. Good first issues are tagged [`good-first-detector`](https://github.com/inboxpraveen/Cleanframe/issues). See [CONTRIBUTING.md](https://github.com/inboxpraveen/Cleanframe/blob/main/CONTRIBUTING.md).
|
|
316
|
+
|
|
317
|
+
## Sponsoring
|
|
318
|
+
|
|
319
|
+
CleanFrame is free, Apache-2.0, and will stay that way for individuals — no feature is paywalled for a person with a laptop and a messy CSV. If it saves your team recurring hours, [sponsorship](https://github.com/sponsors/inboxpraveen) funds detector coverage, the benchmark, and long-term maintenance.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
<p align="center"><i>Profile it once. Recipe it forever.</i></p>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
cleanframe/__init__.py,sha256=947WkKRrrVSiVn0NG-LLMoRl3KUmFj7merh88JorMhg,4593
|
|
2
|
+
cleanframe/__main__.py,sha256=jDugqVoLttPLAx-RcORml3IvazaILe4eBlVI_mtZedw,137
|
|
3
|
+
cleanframe/_util.py,sha256=1bLeAxiGUxafwSQntU-PAe9064IoDz8glJDmlUHk1eA,16689
|
|
4
|
+
cleanframe/_version.py,sha256=VrXpHDu3erkzwl_WXrqINBm9xWkcyUy53IQOj042dOs,22
|
|
5
|
+
cleanframe/api.py,sha256=QET40dZFIpIsDq6JDXDsPJwrE8kaZ1m0gFuZvnVwSIM,22241
|
|
6
|
+
cleanframe/cli.py,sha256=ULAkD74CdojE0rWrJQm8PM3bHilK6a6Yx6CDS2M18Zo,26107
|
|
7
|
+
cleanframe/codegen.py,sha256=jD9su79OX1yNEg0iW-4mghuKGmou__MpagB52tjOxes,25334
|
|
8
|
+
cleanframe/dataio.py,sha256=v7iwUhjxXayz628QiaGTnGmXAlHXfwpr0OOT01q45y0,22046
|
|
9
|
+
cleanframe/diff.py,sha256=v1NkgTrE3S95a-oKgY8zBRwF_Mu5W4YYDsqgR_0NmW8,14470
|
|
10
|
+
cleanframe/drift.py,sha256=wVt8-XkBWVpgvd2bQxir1q39H1rGITOcKbxnw7k48i0,11235
|
|
11
|
+
cleanframe/errors.py,sha256=-k0eDLhi_1T646o8RyWKBDbh9RIo1STmgiRiPZo5Ecg,2053
|
|
12
|
+
cleanframe/executor.py,sha256=gQeKxTWcDAeiWzLOzej3_DYhWK0tFdbTOPbfEQuP2R0,9773
|
|
13
|
+
cleanframe/fingerprint.py,sha256=JOva4_Wc1D5DtIreusvF8TSMREzF7g86UqY9C_mgj44,2954
|
|
14
|
+
cleanframe/issues.py,sha256=F5jQDHiaK08WOd6zwnxoSJCSx7gL_mpgpbelZ4uz5Yo,6338
|
|
15
|
+
cleanframe/llm.py,sha256=vKgl5bYC761_tEWVlUpa0-_QO-i-U2MXhGg-GWBFrv0,30089
|
|
16
|
+
cleanframe/ops.py,sha256=LdIZEn-YkNBq9O400hqg_iUnwxCH7HFwqviBry4gCw8,45310
|
|
17
|
+
cleanframe/planner.py,sha256=ApEQyY_x62wL0btpqeNEVFY6kaSNnIM_e3t3NLgqLXY,13602
|
|
18
|
+
cleanframe/profile.py,sha256=vWCVn9phwXnSrcdRsKV9qgxKsIZxF7Ue0-wmJPQ-UcU,15329
|
|
19
|
+
cleanframe/py.typed,sha256=yom9ZG2qJFkQISkyGP_MrEJ934_T8bfirKkD33Ou5m0,72
|
|
20
|
+
cleanframe/quality.py,sha256=hArak02ElyEFUeZHCSYyQe8nLwgjoahBGJ8eutvpJhc,2653
|
|
21
|
+
cleanframe/readfix.py,sha256=MmGP_RO9ZvbCJihYMfOf8cakL2yza0ZzteV-GkrTeY4,6410
|
|
22
|
+
cleanframe/recipe.py,sha256=watmw6auTWPT5fPcJBQV4ftfyTh5SnaIJlJr5mSh_Fo,15623
|
|
23
|
+
cleanframe/report.py,sha256=IUHFrQn5INSyvvo0DbDzrHRocfKNp7brm3wC5sK7C80,15486
|
|
24
|
+
cleanframe/result.py,sha256=gOwCXdB3qn4SuH8Af6O0-RwAXoWWC9kiqVwcguNozgk,4770
|
|
25
|
+
cleanframe/schema.py,sha256=yNBQL_iohmtUD5Ul56KV4c5z26hp8ieY8bwOnOUznkc,9627
|
|
26
|
+
cleanframe/streaming.py,sha256=Z4zXQsK0mov6heiZ7kZiCXyQYt74RIJ9X6OQ7cmRync,14982
|
|
27
|
+
cleanframe/types.py,sha256=1UXMQTA7SKJY4H78Z1GT8EqgNPp3Kg9sULvfS3AMwjU,4327
|
|
28
|
+
cleanframe/validate.py,sha256=ueKliGEOVkHEg171jHKx-Ze2BDpDOFMZUupHN35vfd0,12909
|
|
29
|
+
cleanframe/workbook.py,sha256=qdkQvPZ199jx6LveZFPEJsrObzAyBUARi0amp9ASkFg,14833
|
|
30
|
+
cleanframe/detectors/__init__.py,sha256=1DkQ32c8Bd7ntBxUjNs8Rscvsk0YhB4L-gKBK74dULY,1399
|
|
31
|
+
cleanframe/detectors/base.py,sha256=8ggoL8Nrpw2ZsDUopgoxFLFOaI-4rBaPMiCZ1uzwTGE,7030
|
|
32
|
+
cleanframe/detectors/categories.py,sha256=XkOGgttHVzu1-hK3B_ga10r80Nj3XJ8fZJIs7R8gZDo,7643
|
|
33
|
+
cleanframe/detectors/contacts.py,sha256=5PVOhbXOqhuOeMtIhu0ZOqHj-MoeLNAtC1SKoDobSHI,3815
|
|
34
|
+
cleanframe/detectors/currency.py,sha256=RMFD2s6cQT-FCkzp7x8YKoOs9HK9H75RS4ic6aLt-_c,4035
|
|
35
|
+
cleanframe/detectors/dates.py,sha256=P3ETEVaqXSBWtykBZzzt53Z2TBqqUyEjnDMTKlGQz_E,8204
|
|
36
|
+
cleanframe/detectors/dedup.py,sha256=4rL1qZgT6237pi-nDpTbUaNJ-HITSOO8mSJRNQijYvs,5413
|
|
37
|
+
cleanframe/detectors/nulls.py,sha256=JS8QRX18Iw468ok4Ql65KmUgkYgUt7GRH3RPTLoirHU,4525
|
|
38
|
+
cleanframe/detectors/outliers.py,sha256=TUkruFglRh4S8me4hlekMeHrSEqaTd3kae68sZZ68y0,2302
|
|
39
|
+
cleanframe/detectors/schema_mapping.py,sha256=luk6W17AbjQZf_oarGhYMsn-nXNISKuEULGHMB2vj34,4500
|
|
40
|
+
cleanframe/detectors/text.py,sha256=ZpDP02wsGkjEJTI6ZDRaOtCgnXEf_1Xz1ny34ZcIGlI,3596
|
|
41
|
+
cleanframe/detectors/units.py,sha256=veoI0KrYt5ZnAUqNiQ-b4Wwj4kcYEXO4WgZAxOR3Qg8,2714
|
|
42
|
+
cleanframe_engine-0.3.0.dist-info/METADATA,sha256=Do34N8eY0PY-uz6gNSwPBrRoXLlPoUVElyoaWf1zmW0,15626
|
|
43
|
+
cleanframe_engine-0.3.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
44
|
+
cleanframe_engine-0.3.0.dist-info/entry_points.txt,sha256=fA7joq6i0LEYJ512S7Gkgt5l9nqN74AipUD3O2vFOxA,51
|
|
45
|
+
cleanframe_engine-0.3.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
46
|
+
cleanframe_engine-0.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|