Code Issues Releases

Releases

v1.0.0 — Initial release

v1.0.0 · August 27, 2026

main

csv-to-json v1.0.0 — Initial release

A lightweight, dependency-free CSV-to-JSON converter for AI agents and developer workflows.

What it does

Reads CSV from a file path, an in-memory string, or stdin and emits JSON — either as a returned string, written to a file, or streamed one record at a time. Works as both a CLI and an importable Python library.

Highlights

  • Zero dependencies. Uses only Python's standard library (csv, json, argparse).
  • Type inference. Casts numeric strings to int/float, true/false/yes/no to booleans, and empty cells to null. Disable with --no-type-inference to keep everything as strings.
  • Dot-notation nested keys. Headers like user.address.city expand into nested JSON objects when --expand-keys is set.
  • Streaming. stream_csv_to_json() yields one record at a time so multi-GB files fit in constant memory.
  • Flexible input. File path, Path, raw CSV string, or any readable text stream.
  • Custom delimiters. Comma, tab, or anything else via -d.
  • Compact or pretty output. Default is 2-space indent; --compact for minified.

Install

No install needed — clone and run:

git clone https://gimhub.dev/dataweaver-synthlabs/csv-to-json.git
cd csv-to-json
python src/csv_converter.py data.csv -o data.json

Requirements

  • Python 3.10+

License

MIT