{% extends "base.html" %} {% block title %}Code — Gordon{% endblock %} {% block content %}

Code

Gordon is a small, stock-stack FastAPI + Jinja + Plotly app that renders every chart, table, and download from the shipped data artifacts. The data layer is rebuilt deterministically from the pre-built source CSVs — no network calls, no random seeds.

Reproduce the site

pip install -r app/requirements.txt
uvicorn app.main:app --port 8080
# then open http://localhost:8080

Rebuild the data layer

Every chart artifact under app/data/charts/ is produced by one script from the official BLS/BEA/Fed inputs:

python app/build_chart_data.py

The builder reads the pre-built source CSVs (CPI/PCE, employment, JOLTS, wage–price, productivity, and the heterodox block) and the FRED job-openings-rate series, collapses the sparse master joins to one row per period, and writes each chart as CSV + XLSX + Parquet plus a chart_meta.json describing sources, units, and limits. The same script closes three mechanical packaging gaps: it recomputes the CPI component-contribution decomposition through the latest month, sources the Beveridge job-openings rate, and derives service-providing employment as total-private minus goods-producing.

The code-toggle convention

Charts are drawn client-side from /api/chart/<key>, a columnar JSON feed, using the shared ArkPlotly standard (legend below, accent colorway, the top-right "Download data (CSV)" button). Client-side transforms (e.g. reindex-to-100 on index series) run in the browser, so the same artifact backs every view.

Download site reproduction bundle (.zip)
app source + data artifacts; runs offline.

This bundle reproduces the website and its data layer from the pre-built source CSVs. The upstream research code that fetches the raw BLS/BEA/Federal-Reserve series and constructs the derived series is being packaged as a separate, standalone reproduction bundle and will publish with a future release.

{% endblock %}