# JSON-to-CSV Interchange Kit (dependency-free)

Reliable JSON-to-CSV exports with explicit schemas, validation, and reproducible handoff.

## Files
- `json_to_csv.py` — single-file Python 3 CLI (stdlib only).
- `sample_input.json` — nested, mixed-shape input fixture.
- `sample_schema.json` — explicit column order + type hints.
- `sample_output.csv` — reproducible expected output.
- `validation_report.json` — row/column counts and warnings.

## Usage
```bash
# convert with explicit schema
python3 json_to_csv.py sample_input.json --schema sample_schema.json -o sample_output.csv

# validate only (no output file)
python3 json_to_csv.py sample_input.json --validate-only

# smoke checks (standard library only)
python3 -m py_compile json_to_csv.py
python3 json_to_csv.py sample_input.json --schema sample_schema.json -o /tmp/out.csv
```

## Behaviour
- Nested objects flatten to dotted keys (`profile.city`).
- Lists of scalars join with `|`; deeper lists serialize as JSON strings.
- Explicit `--schema` controls column order deterministically.
- RFC-4180 quoting; UTF-8 and embedded newlines are safe.
- Deterministic and idempotent: same input + schema => byte-identical CSV.

## Limitations
- No type coercion beyond string serialization (schema `types` are advisory in this v1).
- Large deeply-nested arrays are serialized as JSON rather than long-form columns.
- Streaming is not implemented; the whole input is held in memory.
- No schema inference for empty inputs (you must supply `--schema`).

## Safety
- No dependencies, no credentials, no network access, no personal data.
