Dataset Cleaner & Exporter

v0.2.0
io.github.Nero-Engine/dataset-cleaner-exporter Checked 35 minutes ago Published 6 days ago

Dedupe, flatten and clean messy JSON rows (emails, phones, URLs, HTML) in one call, as JSON or CSV.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_capabilities

Returns the exact cleaning rules (how emails, phone numbers and URLs are detected and normalized), the dedup modes and keep strategies, the order the steps run in, and the maximum rows per call. Call this first if you are unsure how a field will be treated. Free, processes no data.

clean_rows

Deduplicates, flattens and cleans a list of JSON rows in one call and returns spreadsheet-ready rows (or CSV text) plus a summary with exact counts: rows in, rows added by expansion, duplicates removed, rows dropped by maxItems, rows out, the final column list, per-column fill rates and warnings. Steps, in order: optionally explode one array field into one row per entry; flatten nested objects into columns (address.city becomes address_city); trim text; lowercase valid emails; reduce phone numbers to digits with any leading +; lowercase URL hosts and drop the trailing slash; optionally strip H…

ParameterTypeDescription
rows *arrayThe rows to clean. Each row is a JSON object; keys may differ between rows and values may be nested.
cleanFieldsbooleanDefault true. Normalize emails, phone numbers and URLs, detected by field name or value shape.
coerceTypesbooleanDefault false. Turn "42" into 42 and "true" into true. Leading-zero values like "007" stay text.
columnRenameMapRename columns after keep/remove, as ["oldName:newName"] or {"oldName":"newName"}, for example {"Details_founded":"founded"}.
columnsToKeeparrayKeep only these columns (flattened names). Takes priority over columnsToRemove.
columnsToRemovearrayDrop these columns (flattened names). Ignored if columnsToKeep is set.
dedupKeysarrayFields that identify a duplicate, for example ["Email"]. Empty compares the whole row. Use the final column names: flattened (Details_founded) and renamed. Exact and case-sensitive. Rows where every k…
dedupModestringHow duplicates are found. normalized (default) ignores case and whitespace; exact needs identical values; fuzzy also merges near-duplicates (up to 1000 rows and 1000 characters of key text, so name a…
dropEmptyFieldsbooleanDefault false. Remove null and empty fields from each row.
emptyToNullbooleanDefault true. Blank text becomes null.
expandArrayFieldstringOptional. One top-level array field (for example "offers") to explode into one row per entry, repeating the other fields. Object entries become columns. The expanded total must stay within the row lim…
flattenbooleanDefault true. Turn nested objects into flat columns. Arrays become one JSON-text cell.
flattenSeparatorstringJoins nested key paths when flattening. Default "_".
keepStrategystringWhich duplicate survives: most_complete (default, fewest empty fields), first or last.
maxItemsintegerOptional cap: read at most this many rows and return at most this many. 0 (default) means no cap.
outputFormatstringjson (default) returns rows; csv returns the same result as CSV text in "csv" instead.
similarityThresholdnumberFuzzy mode only. 0.5 to 0.99, default 0.9. Higher is stricter.
stripHtmlbooleanDefault false. Remove HTML tags and decode common entities in text.