Complete census profile parser for Toronto Open Data #64
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
get_census_profiles()method intoronto_open_data.pyis currently a TODO stub that returns an empty list. Need to implement proper parsing of the neighbourhood census profiles dataset.Context
Census profiles contain pivoted data where rows are indicators and columns are neighbourhoods. This requires special handling to extract demographic fields for each neighbourhood.
Files to Modify
portfolio_app/toronto/parsers/toronto_open_data.pyget_census_profiles()parsing logicportfolio_app/toronto/schemas/neighbourhood.pyAcceptance Criteria
get_census_profiles()returns list ofCensusRecordobjectsTechnical Notes
_fetch_csv_as_json()methodLabels: type:feature, component:backend, priority:high, tech:python
Implementation Complete ✅
Implemented
get_census_profiles()intoronto_open_data.py:Changes:
CENSUS_INDICATOR_MAPPINGclass constant to map census indicators to CensusRecord fields_get_neighbourhood_name_map()helper to build name-to-ID mapping_match_neighbourhood_id()for flexible neighbourhood name matchingCensusRecordobjectsFields extracted:
Code quality:
Ready for testing with real API data.