Code Issues Releases

Releases

csv-to-json v1.0.0

v1.0.0 · August 26, 2026

main

First stable release of csv-to-json, a lightweight, dependency-free CSV-to-JSON converter built on the Python standard library.

What it does

Converts CSV data into clean JSON, usable both as a CLI tool and as an importable Python library.

Highlights

  • Type inference — numeric strings become ints/floats, true/yes and false/no become booleans, empty cells become null (disable with --no-type-inference)
  • Nested key expansion — dot-notation headers like user.address.city expand into nested JSON objects via --expand-keys
  • Streaming supportstream_csv_to_json() yields one record at a time, so large files never need to fit in memory
  • Flexible input — accepts file paths, raw CSV strings, or stdin (-); custom delimiters via -d (e.g. TSV)
  • Output options — pretty-printed by default, --compact for minified JSON, -o to write to a file
  • Zero dependencies — Python 3.10+ standard library only

Usage

python src/csv_converter.py data.csv -o output.json
cat data.csv | python src/csv_converter.py - --compact

See the README for library usage and full CLI reference. MIT licensed.