data-transform
Skill1 starsChanged 6 days agoMITView on GitHub
This skill should be used when the user asks to "convert CSV to JSON", "transform data to SQL", "turn JSON into a table", "flatten nested JSON", "convert to YAML", "generate INSERT statements", "parse and reshape data", "normalize my CSV", "export data as markdown table", "convert spreadsheet data", "transform my data format", "change file format", "convert NDJSON to CSV", "explode array field", or mentions converting between data formats like CSV, JSON, SQL, YAML, TSV, Markdown tables, TOML, or NDJSON. Also use this skill when the user asks to "infer schema from data", "detect column types", "what columns are in this file", "generate CREATE TABLE from my data", "find null values", or "validate data structure". Use this skill any time a user pastes data and wants it in a different format — even if they just say "can you turn this into JSON" or "make this a table" without naming a specific format.
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Starlitnightly/omicversetheir own version, first seen Oct 8, 2026
- johnson7788/collect_skillstheir own version, first seen Apr 29, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Starlitnightly/omicverse★ 1.4ksame name
- johnson7788/collect_skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 90
Run these three commands in sequence before committing to a conversion:
- Very specific: line 127
When --no-infer is not set, string values are parsed in this order:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Transform
Convert CSV, TSV, JSON, NDJSON and YAML (input) into any of CSV, TSV, JSON, NDJSON, SQL,
YAML, Markdown tables and TOML (output) with two bundled Python scripts. XML, TOML and
Markdown are not accepted as input. Handles encoding detection, type inference, null
normalization, nested-object flattening, array explosion, and large-file streaming. Only the
standard library is needed, except that reading YAML requires pip install pyyaml.
Quick Start
# Basic conversion
python scripts/transform.py data.csv --to json
python scripts/transform.py data.json --to sql --table users
python scripts/transform.py data.csv --to markdown
# Flatten nested JSON before converting to CSV
python scripts/transform.py nested.json --to csv --flatten
# Explode an array field (one row per element)
python scripts/transform.py orders.json --to csv --explode items
# Understand your data first
python scripts/infer_schema.py data.csv --output summary
# Stream a large file without loading it all into memory
python scripts/transform.py big.csv --to ndjson --stream
# Pipe from stdin
cat records.ndjson | python scripts/transform.py --from ndjson --to csvFormat Support Matrix
| From \ To | CSV | JSON | NDJSON | SQL | YAML | Markdown | TOML |
| CSV / TSV | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| JSON | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ |
| NDJSON | ✓ | ✓ | — | ✓ | ✓ | ✓ | — |
| YAML | ✓ | ✓ | ✓ | ✓ | — | ✓ | — |
Key Options: transform.py
| Flag | Default | Purpose |
--to | (required) | Output format: json ndjson csv tsv sql yaml markdown toml |
--from | auto | Force input format when piping stdin |
--table | data | Table name for SQL output |
--dialect | sqlite | SQL dialect: sqlite mysql postgres |
--batch | 500 | Rows per SQL INSERT statement |
--delimiter | , | Input CSV field delimiter |
--no-header | false | Input CSV has no header row |
--null-values | null,NULL,N/A,… | Comma-separated strings to treat as NULL |
--flatten | false | Recursively flatten nested JSON objects |
--sep | __ | Key separator for flattened paths (e.g. address__city) |
--explode FIELD | — | Expand array field: one row per element. Also accepts a nested path (user__tags or user.tags); an empty array keeps the row with the field set to null. Runs before --flatten |
--no-infer | false | Keep all values as strings (skip type inference) |
--stream | false | Write rows as they are read (CSV/TSV/NDJSON output). CSV/TSV/NDJSON input is read row by row; JSON/YAML input is still parsed whole. CSV columns come from the first row (a warning lists columns dropped later) |
--pretty | false | Pretty-print JSON output |
--encoding | auto | Force input encoding (e.g. latin-1, cp1252) |
-o FILE | stdout | Write output to file instead of stdout |
Key Options: infer_schema.py
| Flag | Default | Purpose |
--output | json-schema | Output mode: json-schema sql summary |
--table | data | Table name for SQL output |
--sample | 1000 | Max rows to analyze |
--enum-threshold | 20 | Max unique values before dropping enum detection |
Recommended Workflow for Unknown Data
Run these three commands in sequence before committing to a conversion:
# 1. Inspect what you have
python scripts/infer_schema.py myfile.csv --output summary
# 2. Preview the conversion
python scripts/transform.py myfile.csv --to markdown | head -20
# 3. Run the real conversion
python scripts/transform.py myfile.csv --to json --pretty -o output.jsonHandling Common Edge Cases
Encoding problems — The script auto-detects UTF-8 and Latin-1. For Windows
files, pass --encoding cp1252. For UTF-8 with BOM, the auto-detector handles it.
Semicolon-delimited CSV (common in European Excel exports) — pass --delimiter ";".
Custom null values — extend the default list: --null-values "null,NULL,N/A,#N/A,-,unknown".
Numbers stored as strings — type inference is on by default; pass --no-infer to
keep everything as string (useful before a SQL COPY load where the schema is already defined).
Nested JSON to SQL — chain --flatten with --to sql to produce a flat table with
double-underscore column names (address__city, address__zip).
One row per order item — use --explode items where items is the array field name.
Files > 100 MB — use --stream with NDJSON/CSV input and NDJSON/CSV output. Convert big JSON arrays to NDJSON first, because JSON input is parsed as a whole.
PostgreSQL COPY format — use --dialect postgres with --to csv then import with
\COPY tablename FROM 'file.csv' CSV HEADER;.
Type Inference Rules
When --no-infer is not set, string values are parsed in this order:
- NULL — value is in the
--null-valueslist or is an empty string →None - Boolean — case-insensitive
true/false/yes/no/on/off→True/False - Integer — plain ASCII digits, optional sign, no leading zeros (
007and ZIP codes like01234stay strings, as does1_000) →int - Float — decimal or scientific notation (
41.5,1e5,.5) →float.nanandinfstay strings, because they are not valid JSON numbers - String — everything else
SQL output promotes types per column: if a column has mixed int and float values, the whole column becomes REAL/DOUBLE.
Additional Resources
Reference Files
references/format-specs.md— Per-format edge cases: CSV quirks, JSON null handling, SQL dialect differences, YAML boolean gotchas, encoding notes.references/transform-patterns.md— Ready-to-run recipes: normalizing API responses, log analysis, database seed data, pivot-style reshaping, joining two CSVs, batch processing a directory of files.
Scripts
scripts/transform.py— Main conversion engine. Run with--helpfor full usage.scripts/infer_schema.py— Schema inference. Outputs JSON Schema draft-07, SQL DDL, or a human-readable column summary with type, nullability, and sample values.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

