NZLUD Studio: Four Tools on the National Zoning Database
A dashboard, a full text search engine, a score audit, and a local AI assistant built on the National Zoning and Land Use Database: 2,900 municipal zoning codes and restrictiveness scores for 2,745 cities.

- Role
- Solo. Data extraction, search index, scoring reimplementation, retrieval pipeline, and all four interfaces
- Timeframe
- Summer 2026 · About a week, plus model swaps
- Location
- United States (2,745 municipalities)
- Tools
- Python
- SQLite FTS5
- Flask
- MLX
- Leaflet
- JavaScript
- Claude Code
The dataset
The National Zoning and Land Use Database (Mleczko and Desmond, 2023) is the largest open collection of American zoning codes I know of: about 2,900 municipal ordinances as plain text, plus a Zoning Restrictiveness Index (ZRI) score for 2,745 municipalities built by keyword scoring those codes. That is 7 GB of text, far too much to read. I wanted to be able to ask it questions, so I built four tools on it and put them behind one server I call NZLUD Studio.
1. ZRI Explorer
A self-contained dashboard of the restrictiveness index: a national map colored by score, state and metro filters, sortable rankings of the most and least restrictive places, score distributions, and a detail view per city. It is one 130 KB HTML file, so it runs on this page.
2. Full text search
Every ordinance, chunked into 2.24 million section tagged passages and indexed with SQLite’s FTS5, so a phrase like “accessory dwelling unit” or “minimum lot size” comes back in a fraction of a second with highlighted snippets grouped by municipality. You can open any hit in the context of its full code, filter by state, and pin two cities side by side to compare how they handle the same topic.
3. Score transparency
A ZRI score means little unless you can see which passages triggered it. I rebuilt the paper’s scoring method (keyword matches inside a 250 character window, weighted and summed against a threshold) and ran it over all 2,639 codes. The result is a per city audit: which of the 22 measures fired, the best matching passage for each, and how the city compares with national trigger rates. My rebuilt signal count correlates with the official index at r = 0.64, close enough to trust the evidence view, and the gap shows where the paper’s method leaves room for judgment.
4. Local zoning assistant
A chat assistant that answers questions about one municipality’s code with citations, running entirely on my laptop. It uses the search index for candidate passages, a small embedding model to rerank them, and a local 14 billion parameter language model to write the answer. The prompt forbids reasoning by analogy and any number that is not in the retrieved text, and the model is hot swappable between Qwen3 and Gemma 3.
Notes
The search index (10 GB) and the assistant’s model are local only, so only the explorer is hosted here. I built all four with Claude Code as a pair programmer. The retrieval design started as a smaller assistant for Kettering’s zoning code, which was the first version of the idea.