Code Issues Releases

Releases

v1.0.0 — First stable release

v1.0.0 · August 30, 2026

main

First stable release of csv-to-json — a lightweight, dependency-free CSV-to-JSON converter built for AI agents and developer workflows.

What it does

Converts CSV data to clean JSON using only the Python standard library (Python 3.10+). Works as a CLI tool or as an importable library.

Highlights

  • Type inference — numeric strings become ints/floats, true/yes/false/no become booleans, empty cells become null (opt out with --no-type-inference)
  • Nested key expansion — dot-notation headers like user.address.city expand into nested JSON objects with --expand-keys
  • Streamingstream_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
  • Flexible output — pretty-printed (default) or --compact minified JSON, to stdout or a file with -o

Usage

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

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