Skip to content

Releases

v1.0.0 — 28.6M Public Madrid Loans Medallion, Gold Star Schema & Classic BI

Choose a tag to compare

@tomcrojo tomcrojo released this 22 Nov 20:35

First public release of Spain Book Analytics: a reproducible Medallion pipeline over 28.6 million open Madrid public-library loan records, with a Gold star schema, a semantic layer, a default-deny publication gate and a static BI dashboard.

What's included

  • Medallion pipeline (Polars + DuckDB): Bronze parser for 139 monthly CSVs and 11 header schemas, with quoting repair and width quarantine; Silver typing, network mapping and deduplication on barcode + timestamp within each month; Gold star schema (fact_loans plus conformed dimensions and marts).
  • Semantic layer: semantic/metrics.yaml, validated against the public Gold Parquet files by scripts/validate_semantic.py.
  • Publication gate: default-deny, hash-bound policy; scripts/export_audit.py audits the git inventory for oversized files, forbidden paths, cells below 5 and small values recoverable by subtraction.
  • Public aggregates: gold_public/madrid/ and seeds/public/, with no per-loan rows, barcodes or timestamps.
  • Dashboard: dashboard/index.html, plain JavaScript and hand-built SVG, no build step or CDN.
  • CI: secret scan (Gitleaks 8.30.1), ruff, reviewed tree inventory, export audit, semantic validation, synthetic and public-sample pipeline runs, publication gate, pytest and chart reproducibility.

Measured on the full local run

  • 28,587,254 raw rows parsed; 615,244 duplicate loan events removed; 27,883,133 loans in the analytical universe (the 2025-05 file repeats April and is quarantined).
  • Months missing at source (2017-11, 2018-01, 2020-04, 2020-05) are kept as NULL, never 0.
  • S1-2026 reconciliation against the published municipal figure: 99.8 %.

Not included

Raw files, Bronze/Silver Parquet and the private Gold database stay on the machine that ran the pipeline; rebuild instructions are in the README. Data keeps its own terms (see DATA_LICENSES.md); code and documentation are MIT. Databricks (v2.0) and predictive BI (v3.0) are planned and not built.