Recipes / Data & reports
CodexWorkflowData & reports

Explore, clean and chart a dataset with a coding agent

A workshop handout for data journalists: use Claude Code or Codex to ask questions of a database, clean messy codes, build visualizations and scrape data.

From Simon Willison · Blog · Mar 2026

Setup time30 min
CostPay-per-token (the workshop spent $23 total)
RunsPer dataset
NeedsCodex or Claude Code, Python, SQLite, Datasette (optional)
Last updated2026-10-17

What the source did

  • Ran a 3-hour workshop on GitHub Codespaces with a budget-restricted Codex key.
  • Had attendees query SQLite, decode neighborhood codes and scrape with agents.
  • Served a viz/ folder through Datasette and had Claude Code build an interactive Leaflet heat map there.

Summary written by Agent Cookbook from the original post. See the original for the full context. How we source recipes

Our notes

What it takes
Claude Code or Codex with Python, SQLite and Datasette. Simon Willison ran his 3-hour NICAR 2026 workshop for data journalists on GitHub Codespaces with a budget-restricted Codex API key, and attendees used $23 of tokens across it.
Where it breaks
Results nobody checked: the handout gives evaluating the results its own section, and its cleaning exercise ends with verifying the decoded neighborhood codes.
Human checkpoint
You evaluate the agent's findings and verify any codes it decodes before you use them. Look at each chart it builds too: his Claude Code vibe-coded a Leaflet heat map straight into a viz/ folder that Datasette served.
Tools involved
Codex or Claude Code, Python, SQLite, Datasette (optional)

✓ Verified Source link checked and still live. Notes by Thomas, editor. How we verify

Read their guide

Made and published by Simon Willison. Start here; it is their original, not ours.

Approval rule

🛡
The agent writes to a copy; the original data file stays read-only.

Set it up

  1. Put the data in a fresh folder or Codespace.
  2. Set a spending cap on the API key if you use one.
  3. Work through the handout's exercises on your own data and check the SQL yourself.
  4. Open the viz file locally.

Common failures

⚠
  • Agents state numbers confidently; always ask for the query behind a figure.
  • Scraping steps may break site terms. Check before running.

Variations

  • Point Datasette at viz/ so new charts show up live.
  • Use the same flow for spreadsheets exported to CSV.

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

Same job: Data & reports

Claude CodeFull setup

An isometric pixel-art map of his village, built by Claude Code from open data

Jankees rebuilt his village, Helenaveen in the Netherlands, as a zoomable isometric pixel-art map with Claude Code: every house and tree in its real place, rendered from Dutch open data, with traffic, an evening mode and a tour of historical places. He put the prompt he used behind a 'Make your own village' button so anyone can paste it into their agent, and people have already made maps of other Dutch towns with it.

Not stated. His pipeline rebuilds the whole map in about two minutes once it's set up, his README saysvia X
Claude CodeFull setup

A toy-train model of his city where every train and bus runs on real data, coded by Claude Code

A Reddit user built a 3D world in the look of an N gauge model railway, on the real German city of Fürth and the line to Munich. Claude Code wrote the engine from scratch in Swift and Metal while he directed and tested. Everything that moves runs on recorded real data from one day: every train, S-Bahn, U-Bahn, tram and bus, river levels, wind turbines at the measured wind speed, free car-park spaces, the sun and 2.55 million catalogue stars.

He says the project is a good week old; the 6-minute film is 22,680 frames rendered from the app on two Macsvia Reddit
Grok BotFull setup

3D campus dashboard for your Grok Bot teams

Sar runs 9 teams and 34 bots. His main bot, Mika, built a private 3D campus on Vercel that shows who's working, approvals waiting, usage battery by team and bot, and scheduled tasks, with approve buttons on the page. He published the repo skill and a demo.

Built over rounds with his main bot, Mika; he shared no clock timevia X

More Codex recipes

In these guides: AI research agents →

Get their template ↗Read original ↗