Code Issues Releases

Releases

csv-to-json v1.0.0

v1.0.0 · August 29, 2026

main

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

What it does

  • Reads CSV from a file path, a raw string, or any text stream (including stdin)
  • Emits JSON either as a return value, to stdout, or to an output file
  • Type inference: converts numeric, boolean (true/false/yes/no), and empty values to their native JSON equivalents (opt-out with --no-type-inference)
  • Nested-key expansion: headers using dot-notation (e.g. user.address.city) become nested JSON objects when --expand-keys is set
  • Streaming: stream_csv_to_json() yields records one at a time for large datasets that shouldn't be loaded fully into memory
  • Custom delimiters via -d/--delimiter for TSV or other formats
  • Compact output with --compact for machine consumption

Usage

python src/csv_converter.py data.csv -o data.json --expand-keys
cat data.tsv | python src/csv_converter.py - -d $'\t' --compact
from src.csv_converter import csv_to_json, stream_csv_to_json

Requirements

  • Python 3.10+
  • Standard library only — no external dependencies

License

MIT