The Data Pipeline · KWL Cadence

The data pipeline (where data comes from → a read)

Internal onboarding. Conceptual — no formulas. The goal is to understand the journey* a signal takes, and why each step exists.*

Where the data comes from — the seven signal families

All public or official, collected per market, at zero licence cost:

Family Source What it tells us
Macro Eurostat consumer confidence, savings intent, retail, inflation — the “commercial weather”
Search Google Trends which brands people are searching for, and how that’s changing
News GDELT the tone of the national news and which themes are rising/falling
Attention Wikipedia who and what is rising in public attention
Watching Netflix the mix of genres a country is watching
Music Spotify charts the mood of the market (tempo, key, mood), and how home-grown the chart is
Brand advertising Google Ads Transparency which brands are actually running ads right now

The journey — collect → clean → normalise → signals

Raw signals can’t be compared as-is, so each goes through a few transformations. You don’t need the maths; you need the why:

Signals become a read

Once normalised, the families are combined into a market’s behavioural read — its mood, whether it’s trading down, whether premium is holding, whether the felt mood diverges from the economy. Every fact keeps its receipt (its source and method travel with it), so nothing downstream can drift from how it was derived.


Deeper — the pipeline (implementation-lead level)

The real mechanics, without the code.

Stage topology. run_quarterly.sh chains three stages (raw collection is run out-of-band first): - Collect (per family, from the Scraper venv) → SQLite tables / Athena. - Enrich — origin_unified.py (artist origin), collect_brand_activity.py (ads), and eu_movers.py (the workhorse: YoY-normalises and de-means every family into eu_movers_<m>.json). - Generate — gen_history.py → gen_editions.py → gen_europe.py.

The transformations, precisely: - Anchor rescale (search). Google Trends normalises each ≤5-term query 0–100 within that query, so brands from different batches aren’t comparable. Each 4-brand batch carries one fixed non-economic anchor; every weekly value becomes round(v / anchor_mean × 50, 2). Anchors are chosen so brands land in the ~10–55 range (weather anchors were replaced by pharmacy terms in method v2.1 because they dwarfed brands and quantised them to 1–2). - YoY / deseasonalise. yoy(df, val, days=56) compares two 56-day trailing windows a year apart — same calendar window each year, which removes seasonality. days=120 for noisier audio. --asof <date> reruns any past quarter with identical maths (this is how history is reconstructed). - De-meaning (international vs local). An INTL set (~45 pan-national brands: Zara, IKEA, Revolut, BMW…) gets a cross-market mean YoY = the “global component”. Each market then reports the local residual = raw − cross-market mean. Domestic brands stay raw; within-market displacement pairs (Lidl − Carrefour) are immune (a relative read). - Position-weighting (music). Every audio aggregate is weighted by (51 − position), so #1 counts 50× and #50 counts 1×. A domestic-only copy (genre-gated) reads mood on the local repertoire, stripping the import layer. - Unified artist-origin. Fuses three independent signals — Wikidata citizenship (P27) (authoritative), ISRC prefix (country of registration, a backstop), and genre language-family markers. Localness = citizenship in the language-family set, else genre-local or ISRC-local. - Validated proxies. Bootstrap Pearson (n=2000, 95% CI): tempo ↔︎ savings-intent r = −0.52, major-key ↔︎ confidence r = +0.43 (pre-registered, France). Only France carries validated correlations today; other markets show domestic mood only where the music tier is full. - Demand × supply tag. demand > +3 & ads > 0 → pressing; demand < −3 & ads > 0 → defending; demand > +3 & ads == 0 → whitespace, but only if the brand is on a verified WHITESPACE_OK allowlist (a 0 is ambiguous — it can mean “no ads” or “wrong domain”).

The receipt contract. Every fact is emitted as {t: claim, r: receipt} with the source + method string welded next to it at generation time, so it can’t drift downstream.


Previous: Platform architecture · Next: Publishing workflow · Analytics methodology.