safety#
Crime safety scoring and ward-level data ingestion. This app owns the data
pipeline for crime statistics; it uses models from the housing app
(Ward, WardSafetySnapshot, Neighbourhood) rather than defining its own.
Models#
No models defined — uses housing.Ward, housing.WardSafetySnapshot,
and housing.Neighbourhood.
Helper functions:
Function |
Description |
|---|---|
|
Maps 0–10 score → categorical level (Very Safe, Safe, …) |
|
Maps 0–10 score → hex color for map markers |
Management Commands#
Command |
Description |
|---|---|
|
Ingest |
|
Validate crime data integrity and consistency |
Data Flow#
Key Design Decisions#
Shared models with housing — crime data lands in
WardSafetySnapshot(owned byhousing) to keep the single source of truth in one app.Score → level/color helpers are defined here rather than on the model to keep the housing app free of safety-specific display logic.
verify_crime_datais a validation command (not a data fetch) — it checks for missing wards, score outliers, and period gaps.