How yashsheth0107/civichack works
Council Tracker is a resident-facing Toronto municipal decision dashboard backed by a data-ingestion, lifecycle-tracking, and vote-prediction pipeline. Its main workflow fetches the City’s report-request and voting datasets, joins follow-up items to recorded outcomes, classifies lifecycle stages, and presents searchable decisions. A separate vote-model branch engineers historical features, trains a pass-probability model, and turns predictions into close-call engagement priorities. Edges reflect README statements and indexed source references; unsampled dashboard and prediction details are represented only where documented.
Main entry points: app.py Streamlit dashboard · train_outcome_model.py Outcome trainer · fetch_datasets.py Dataset downloader · toronto_open_data.py CKAN client
Components 16
Data ingestion
- Dataset configuration
config.py - Dataset downloader
src/ingest/fetch_datasets.py - CKAN client
src/ingest/toronto_open_data.py - Raw datasets
data/raw
Decision lifecycle
- Request-log parser
src/pipeline/load_report_request_log.py - Voting-record parser
src/pipeline/load_voting_record.py - Follow-up join
src/pipeline/join_decisions.py - Lifecycle classifier
src/pipeline/stage.py
Vote prediction
- Vote features
src/model/features.py - Outcome trainer
src/model/train_outcome_model.py - Outcome predictor
src/model/predict.py - Engagement scoring
src/model/engagement_score.py - Trained model
models
Resident experience
- Streamlit dashboard
app.py
Other components
- Resident
- Toronto Open Data
Connections 20
- Resident → Streamlit dashboard: uses
README.md - Streamlit dashboard → Lifecycle classifier: displays stages
README.md - Streamlit dashboard → Engagement scoring: shows priorities
app.py - Streamlit dashboard → Dataset downloader: bootstraps data
app.py - Streamlit dashboard → Outcome trainer: bootstraps model
app.py - Dataset downloader → Dataset configuration: reads settings
src/ingest/fetch_datasets.py - Dataset downloader → CKAN client: finds and downloads
src/ingest/fetch_datasets.py - CKAN client → Dataset configuration: uses endpoint
src/ingest/toronto_open_data.py - CKAN client → Toronto Open Data: requests resources
src/ingest/toronto_open_data.py - Dataset downloader → Raw datasets: saves files
src/ingest/fetch_datasets.py - Follow-up join → Request-log parser: loads requests
src/pipeline/join_decisions.py - Follow-up join → Voting-record parser: loads vote events
src/pipeline/join_decisions.py - Lifecycle classifier → Follow-up join: builds decisions
src/pipeline/stage.py - Outcome trainer → Voting-record parser: loads vote events
src/model/train_outcome_model.py - Outcome trainer → Vote features: builds features
src/model/train_outcome_model.py - Vote features → Voting-record parser: uses event data
src/model/features.py - Outcome trainer → Trained model: saves model
README.md - Outcome predictor → Outcome trainer: uses trained model
src/model/predict.py - Outcome predictor → Engagement scoring: scores predictions
src/model/predict.py - Streamlit dashboard → Outcome predictor: supports exploration
README.md