Convert raw NBA JSON to CSV.
✓ Published0🌍 Public
CCaged
Last edited Feb 9, 2014
Created on Feb 9, 2014
This example converts raw NBA JSON game logs into a single CSV file, first showing the transformation of nested statistics into flat, queryable rows. It reads JSON files for each season and measure type, extracting headers and parameters to build team-level records with prefixed column names like `pace_*` or `def_rating_*`. The script uses the CoffeeScript language and the Node.js `fs` and `csv` libraries, with the `csv().to.path` API to write the output. It also merges team abbreviations from a separate CSV, keying each row by team ID and season.
AI-generated description