Utilities · sync
csv-mage
CSV → JSON / NDJSON / SQL. Schema inferred, duplicates optional.
Input CSV
About
csv-mage is the small, sharp CSV utility every backend secretly needs. It parses with PapaParse, infers each column's type from sampled rows, and renders the result as JSON (pretty-printed array), NDJSON (one row per line), or SQL (CREATE TABLE + INSERTs with quoted identifiers and properly typed literals).
Optional `dedupe: true` drops exact-duplicate rows. `tableName` controls the SQL output's identifier; it must be a valid SQL identifier. `delimiter` defaults to PapaParse's auto-detect — override it for tab-separated or pipe-separated input.
Limits: 8 MB of input, 100k rows per call.
{
"type": "object",
"required": [
"csv"
],
"properties": {
"csv": {
"type": "string",
"description": "The CSV text (up to 8 MB / 100k rows)."
},
"format": {
"type": "string",
"enum": [
"json",
"ndjson",
"sql"
],
"default": "json"
},
"tableName": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
"description": "SQL output only. Defaults to 'imported'."
},
"delimiter": {
"type": "string",
"description": "Override delimiter (defaults to auto-detect)."
},
"hasHeader": {
"type": "boolean",
"default": true
},
"dedupe": {
"type": "boolean",
"default": false
},
"sampleRows": {
"type": "integer",
"minimum": 10,
"maximum": 2000,
"default": 200,
"description": "How many rows to sample for type inference."
}
}
}These are descriptive previews. Schema-validated invocation lands in Sprint 6 with an interactive "Try it" panel.
Reviews (0)
No reviews yet — be the first to share your experience.