From 7684ceb9c0965126f70723cefa6b3c2e0683e989 Mon Sep 17 00:00:00 2001 From: Tudor Sitaru Date: Tue, 6 Jan 2026 16:42:06 +0000 Subject: [PATCH] adding missing la codes to list --- backend/schemas.py | 107 ++++++++++++++++++++++++++++---------------- frontend/index.html | 2 +- 2 files changed, 69 insertions(+), 40 deletions(-) diff --git a/backend/schemas.py b/backend/schemas.py index 68dcfd2..7c41ce8 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -351,48 +351,77 @@ SCHOOL_COLUMNS = ["urn", "school_name", "local_authority", "school_type", "addre # Local Authority code to name mapping (for fallback when LANAME column missing) # Source: https://www.gov.uk/government/publications/local-authority-codes LA_CODE_TO_NAME = { + # Inner London 201: "City of London", 202: "Camden", 203: "Greenwich", 204: "Hackney", 205: "Hammersmith and Fulham", 206: "Islington", 207: "Kensington and Chelsea", 208: "Lambeth", 209: "Lewisham", 210: "Southwark", 211: "Tower Hamlets", - 212: "Wandsworth", 213: "Westminster", 301: "Barking and Dagenham", 302: "Barnet", - 303: "Bexley", 304: "Brent", 305: "Bromley", 306: "Croydon", 307: "Ealing", - 308: "Enfield", 309: "Haringey", 310: "Harrow", 311: "Havering", 312: "Hillingdon", - 313: "Hounslow", 314: "Kingston upon Thames", 315: "Merton", 316: "Newham", - 317: "Redbridge", 318: "Richmond upon Thames", 319: "Sutton", 320: "Waltham Forest", - 330: "Birmingham", 331: "Coventry", 332: "Dudley", 333: "Sandwell", 334: "Solihull", - 335: "Walsall", 336: "Wolverhampton", 340: "Knowsley", 341: "Liverpool", - 342: "St. Helens", 343: "Sefton", 344: "Wirral", 350: "Bolton", 351: "Bury", - 352: "Manchester", 353: "Oldham", 354: "Rochdale", 355: "Salford", 356: "Stockport", - 357: "Tameside", 358: "Trafford", 359: "Wigan", 370: "Barnsley", 371: "Doncaster", - 372: "Rotherham", 373: "Sheffield", 380: "Bradford", 381: "Calderdale", - 382: "Kirklees", 383: "Leeds", 384: "Wakefield", 390: "Gateshead", - 391: "Newcastle upon Tyne", 392: "North Tyneside", 393: "South Tyneside", - 394: "Sunderland", 420: "Isles of Scilly", 800: "Bath and North East Somerset", - 801: "Bristol, City of", 802: "North Somerset", 803: "South Gloucestershire", - 805: "Hartlepool", 806: "Middlesbrough", 807: "Redcar and Cleveland", - 808: "Stockton-on-Tees", 810: "Kingston Upon Hull, City of", 811: "East Riding of Yorkshire", - 812: "North East Lincolnshire", 813: "North Lincolnshire", 815: "North Yorkshire", - 816: "York", 820: "Bedford", 821: "Central Bedfordshire", 822: "Luton", - 825: "Buckinghamshire", 826: "Milton Keynes", 830: "Derbyshire", 831: "Derby", - 835: "Dorset", 836: "Bournemouth, Christchurch and Poole", 837: "Poole", - 838: "Bournemouth", 839: "Durham", 840: "Darlington", 841: "East Sussex", - 845: "Brighton and Hove", 846: "Hampshire", 850: "Portsmouth", 851: "Southampton", - 852: "Isle of Wight", 855: "Leicestershire", 856: "Leicester", 857: "Rutland", - 860: "Staffordshire", 861: "Stoke-on-Trent", 865: "Wiltshire", 866: "Swindon", - 867: "Bracknell Forest", 868: "Windsor and Maidenhead", 869: "West Berkshire", - 870: "Reading", 871: "Slough", 872: "Wokingham", 873: "Cambridgeshire", - 874: "Peterborough", 876: "Halton", 877: "Warrington", 878: "Devon", - 879: "Plymouth", 880: "Torbay", 881: "Essex", 882: "Southend-on-Sea", - 883: "Thurrock", 884: "Herefordshire", 885: "Worcestershire", 886: "Kent", - 887: "Medway", 888: "Lancashire", 889: "Blackburn with Darwen", 890: "Blackpool", - 891: "Nottinghamshire", 892: "Nottingham", 893: "Shropshire", 894: "Telford and Wrekin", - 895: "Cheshire East", 896: "Cheshire West and Chester", 908: "Cornwall", - 909: "Cumbria", 916: "Gloucestershire", 919: "Hertfordshire", 921: "Norfolk", - 925: "Lincolnshire", 926: "Northamptonshire", 928: "Northumberland", - 929: "Oxfordshire", 931: "Somerset", 933: "Suffolk", 935: "Surrey", - 936: "Warwickshire", 937: "West Sussex", 938: "Westmorland and Furness", - 940: "Cumberland", - # Additional codes + 212: "Wandsworth", 213: "Westminster", + # Outer London + 301: "Barking and Dagenham", 302: "Barnet", 303: "Bexley", 304: "Brent", + 305: "Bromley", 306: "Croydon", 307: "Ealing", 308: "Enfield", 309: "Haringey", + 310: "Harrow", 311: "Havering", 312: "Hillingdon", 313: "Hounslow", + 314: "Kingston upon Thames", 315: "Merton", 316: "Newham", 317: "Redbridge", + 318: "Richmond upon Thames", 319: "Sutton", 320: "Waltham Forest", + # West Midlands + 330: "Birmingham", 331: "Coventry", 332: "Dudley", 333: "Sandwell", + 334: "Solihull", 335: "Walsall", 336: "Wolverhampton", + # Merseyside + 340: "Knowsley", 341: "Liverpool", 342: "St. Helens", 343: "Sefton", 344: "Wirral", + # Greater Manchester + 350: "Bolton", 351: "Bury", 352: "Manchester", 353: "Oldham", 354: "Rochdale", + 355: "Salford", 356: "Stockport", 357: "Tameside", 358: "Trafford", 359: "Wigan", + # South Yorkshire + 370: "Barnsley", 371: "Doncaster", 372: "Rotherham", 373: "Sheffield", + # West Yorkshire + 380: "Bradford", 381: "Calderdale", 382: "Kirklees", 383: "Leeds", 384: "Wakefield", + # Tyne and Wear + 390: "Gateshead", 391: "Newcastle upon Tyne", 392: "North Tyneside", + 393: "South Tyneside", 394: "Sunderland", + # Isles of Scilly 420: "Isles of Scilly", + # Unitary authorities (800+) + 800: "Bath and North East Somerset", 801: "Bristol, City of", 802: "North Somerset", + 803: "South Gloucestershire", 805: "Hartlepool", 806: "Middlesbrough", + 807: "Redcar and Cleveland", 808: "Stockton-on-Tees", + 810: "Kingston Upon Hull, City of", 811: "East Riding of Yorkshire", + 812: "North East Lincolnshire", 813: "North Lincolnshire", + 815: "North Yorkshire", 816: "York", + 820: "Bedford", 821: "Central Bedfordshire", 822: "Luton", + 823: "West Northamptonshire", 824: "North Northamptonshire", + 825: "Buckinghamshire", 826: "Milton Keynes", + 830: "Derbyshire", 831: "Derby", + 835: "Dorset", 836: "Bournemouth, Christchurch and Poole", + 837: "Poole", 838: "Bournemouth", # Historic codes (merged into 836) + 839: "Durham", 840: "Darlington", + 841: "East Sussex", 845: "Brighton and Hove", + 846: "Hampshire", 850: "Portsmouth", 851: "Southampton", 852: "Isle of Wight", + 855: "Leicestershire", 856: "Leicester", 857: "Rutland", + 860: "Staffordshire", 861: "Stoke-on-Trent", + 865: "Wiltshire", 866: "Swindon", + 867: "Bracknell Forest", 868: "Windsor and Maidenhead", 869: "West Berkshire", + 870: "Reading", 871: "Slough", 872: "Wokingham", + 873: "Cambridgeshire", 874: "Peterborough", + 876: "Halton", 877: "Warrington", + 878: "Devon", 879: "Plymouth", 880: "Torbay", + 881: "Essex", 882: "Southend-on-Sea", 883: "Thurrock", + 884: "Herefordshire", 885: "Worcestershire", + 886: "Kent", 887: "Medway", + 888: "Lancashire", 889: "Blackburn with Darwen", 890: "Blackpool", + 891: "Nottinghamshire", 892: "Nottingham", + 893: "Shropshire", 894: "Telford and Wrekin", + 895: "Cheshire East", 896: "Cheshire West and Chester", + # County councils (900+) + 908: "Cornwall", 909: "Cumbria", + 916: "Gloucestershire", 919: "Hertfordshire", + 921: "Norfolk", 925: "Lincolnshire", + 926: "Northamptonshire", # Historic (split into 823/824 in 2021) + 928: "Northumberland", 929: "Oxfordshire", + 931: "Somerset", 933: "Suffolk", 935: "Surrey", + 936: "Warwickshire", 937: "West Sussex", + # New authorities (2023 reorganization) + 938: "Westmorland and Furness", 940: "Cumberland", + 941: "North Yorkshire", # New unitary + 942: "Somerset", # New unitary (replaced 931) + 943: "Buckinghamshire", # New unitary (2020, replacing 825 in some datasets) } diff --git a/frontend/index.html b/frontend/index.html index 64321fb..971131f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -249,7 +249,7 @@