Build a Local CSV Dashboard with ChatGPT and Reconcile Its Totals
A useful dashboard must reconcile to its source records. In this tutorial, ChatGPT builds a local HTML dashboard from a fictional sales CSV. We check the paid-record population, negative adjustments, invalid amounts and region filters before trusting the chart.
Prerequisites and scope
You need Python 3, a browser and a disposable copy of your CSV. The demonstrated builder produces one self-contained HTML file, with no CDN, external service or automatic upload of the CSV. The initial request to ChatGPT uses fictional data. An offline dashboard does not imply that attaching a real business export to a chat would keep that export local.
1. Define the numbers before requesting the chart
Ask for build.py exposing build(source, output). State that IDs remain text, canceled rows are excluded, negative paid adjustments are retained, and missing, nonfinite or over-precision amounts appear in a warning instead of becoming zero. Require exact integer-cent arithmetic and a new output path that refuses overwriting an existing file.
Use this small reconciliation table as the acceptance target for the recorded fixture:
| Region | Paid records | Total |
|---|---|---|
| North | 2 | $150.00 |
| South | 2 | $70.00 |
| All | 4 | $220.00 |
South includes a negative five-dollar adjustment. One invalid amount is excluded and reported. A canceled sale must not enter the paid population. For the underlying storage principle, see our guide to integer cents and exact money totals.
2. Review the returned builder
Check that the program uses a real CSV parser rather than splitting each line at commas. Quoted fields can contain commas and line breaks; Python documents this behavior in its CSV module reference. Read the amount-validation and cent-conversion code, including its treatment of negative values.
Inspect both layers of text handling. Embedded JSON must not break out of its script element, and displayed source values must become text rather than raw HTML. The recorded check uses a customer name resembling HTML and confirms it appears literally.
3. Build a new dashboard and reconcile every view
After saving and reviewing the complete generated build.py, run the demonstrated command from your practice directory:
python3 build.py start/sales.csv dashboard-start.htmlOpen the newly created file in your browser. Select North, South and All. For each selection, compare the displayed total and count with the source table, visible records and chart. They must all use the same filtered paid records. Check that leading zeros in IDs remain visible and that the invalid-amount warning has not disappeared.
4. Use fresh data to test the calculation
Add a new North paid record for $10.25 in a separate copy of the CSV and build into another new HTML filename. The all-region total should become $230.25 across five paid records; North should become $160.25 across three. If only the headline changes while the table or chart stays stale, the dashboard has not passed.
The recorded practice checker verifies file creation and overwrite refusal, while the browser review checks the actual filter behavior and rendered values. Neither a successful build nor an attractive chart proves the accounting population is correct.
Keep the report reproducible
Retain the original CSV, the reviewed builder, the exact build command and the reconciliation cases. When your export changes, revisit status definitions, amount precision and column names before rerunning it. This example handles its stated two-decimal fixture; it does not infer currency conversion or a different accounting policy.
Browse the tutorial library for more practical data-verification workflows.
James Kennedy is a writer and product researcher at Drives Hero with a background in IT administration and consulting. He has hands-on experience with storage, networking, and system performance, and regularly improves and optimizes his home networking setup.


