# Scripts

These are the scripts behind the figures on the site. They were written against the
project's working folders; the table maps the paths they expect to the files published
in ../data/ so they can be run as-is after copying the data into those paths.

| Script expects | Published as |
|---|---|
| newdocs/2026-505 - Working Copy (Excel).csv | data/activity_totals_2022_2025_foi_2026-505.csv |
| newdocs/2026-507 - Working Copy (Excel).csv | not published (child-level rows; available on request, see receipts page) |
| data/raw/park_board_*.json, burnaby_swim_*.json, richmond_pm_*.json, surrey_pm_*.json | data/captures/*.json |
| data/processed/park_board_20260520_classified.csv | data/catalogue_snapshot_20260520_classified.csv |
| data/processed/fill_curve.csv | data/fill_curve_fall2026.csv |
| data/denominators.csv | data/denominators.csv |

`analyze_for_site.py`, `analyze_507_repeats.py`, `analyze_format_progression.py` and
`headroom_analysis.py` need `duckdb` (`pip install duckdb`). The scrapers need `requests`;
`scrape_perfectmind.py` and `selenium_helpers.py` need `selenium`.
`data/site_analyses_output.txt` is the saved output of `analyze_for_site.py`;
`data/preschool_ladder_output.txt` is the saved output of `analyze_preschool_ladder.py`
(both scripts also need the unpublished 2026-507 extract for their child-level sections).
