# This map was found here:
# https://gist.github.com/radiac/d91d2ed1b971c03d49e9b7bd85e23f1c#file-uk-counties-to-regions-csv
county_to_region_map = {
    'Guernsey': 'Crown Dependencies', 'IOM': 'Crown Dependencies', 'Jersey': 'Crown Dependencies',
    'North East Derbyshire': 'East Midlands', 'Amber Valley': 'East Midlands', 'Ashfield': 'East Midlands',
    'Bassetlaw': 'East Midlands', 'Blaby': 'East Midlands', 'Bolsover': 'East Midlands', 'Boston': 'East Midlands',
    'Broxtowe': 'East Midlands', 'Charnwood': 'East Midlands', 'Chesterfield': 'East Midlands',
    'Corby': 'East Midlands', 'Daventry': 'East Midlands', 'Derby': 'East Midlands', 'Derbyshire': 'East Midlands',
    'Derbyshire Dales': 'East Midlands', 'East Lindsey': 'East Midlands', 'East Northamptonshire': 'East Midlands',
    'Erewash': 'East Midlands', 'Gedling': 'East Midlands', 'Harborough': 'East Midlands', 'High Peak': 'East Midlands',
    'Hinckley and Bosworth': 'East Midlands', 'Kettering': 'East Midlands', 'Leicester': 'East Midlands',
    'Leicestershire': 'East Midlands', 'Lincoln': 'East Midlands', 'Lincolnshire': 'Yorkshire and the Humber',
    'Mansfield': 'East Midlands', 'Melton': 'East Midlands', 'Newark and Sherwood': 'East Midlands',
    'North Kesteven': 'East Midlands', 'North West Leicestershire': 'East Midlands', 'Northampton': 'East Midlands',
    'Northamptonshire': 'East Midlands', 'Nottingham': 'East Midlands', 'Nottinghamshire': 'East Midlands',
    'Oadby and Wigston': 'East Midlands', 'Rushcliffe': 'East Midlands', 'Rutland': 'East Midlands',
    'South Derbyshire': 'East Midlands', 'South Holland': 'East Midlands', 'South Kesteven': 'East Midlands',
    'South Northamptonshire': 'East Midlands', 'Wellingborough': 'East Midlands', 'West Lindsey': 'East Midlands',
    'Babergh': 'East of England', 'Basildon': 'East of England', 'Bedford': 'East of England',
    'Bedford Borough': 'East of England', 'Bedfordshire': 'East of England', 'Braintree': 'East of England',
    'Breckland': 'East of England', 'Brentwood': 'East of England', 'Broadland': 'East of England',
    'Broxbourne': 'East of England', 'Cambridge': 'East of England', 'Cambridgeshire': 'East of England',
    'Castle Point': 'East of England', 'Central Bedfordshire': 'East of England', 'Chelmsford': 'East of England',
    'Colchester': 'East of England', 'Dacorum': 'East of England', 'East Cambridgeshire': 'East of England',
    'East Hertfordshire': 'East of England', 'Epping Forest': 'East of England', 'Essex': 'East of England',
    'Fenland': 'East of England', 'Forest Heath': 'East of England', 'Great Yarmouth': 'East of England',
    'Harlow': 'East of England', 'Hertfordshire': 'East of England', 'Hertsmere': 'East of England',
    'Huntingdonshire': 'East of England', 'Ipswich': 'East of England',
    "King's Lynn and West Norfolk": 'East of England', 'Luton': 'East of England', 'Maldon': 'East of England',
    'Mid Suffolk': 'East of England', 'Norfolk': 'East of England', 'North Hertfordshire': 'East of England',
    'North Norfolk': 'East of England', 'Norwich': 'East of England', 'Peterborough': 'East of England',
    'Rochford': 'East of England', 'South Cambridgeshire': 'East of England', 'South Norfolk': 'East of England',
    'Southend-on-Sea': 'East of England', 'St Albans': 'East of England', 'St. Edmundsbury': 'East of England',
    'Stevenage': 'East of England', 'Suffolk': 'East of England', 'Suffolk Coastal': 'East of England',
    'Tendring': 'East of England', 'Three Rivers': 'East of England', 'Thurrock': 'East of England',
    'Uttlesford': 'East of England', 'Watford': 'East of England', 'Waveney': 'East of England',
    'Welwyn Hatfield': 'East of England',
    'County Durham': 'North East England',
    'Darlington': 'North East England', 'Durham': 'North East England', 'Gateshead': 'North East England',
    'Hartlepool': 'North East England', 'Middlesbrough': 'North East England',
    'Newcastle Upon Tyne': 'North East England', 'North Tyneside': 'North East England',
    'North Yorkshire': 'Yorkshire and the Humber', 'Northumberland': 'North East England',
    'Redcar and Cleveland': 'North East England', 'South Tyneside': 'North East England',
    'Stockton-on-Tees': 'North East England', 'Sunderland': 'North East England', 'Tyne and Wear': 'North East England',
    'Allerdale': 'North West England', 'Barrow-in-Furness': 'North West England',
    'Blackburn with Darwen': 'North West England', 'Blackpool': 'North West England', 'Bolton': 'North West England',
    'Burnley': 'North West England', 'Bury': 'North West England', 'Carlisle': 'North West England',
    'Cheshire': 'North West England', 'Cheshire East': 'North West England',
    'Cheshire West and Chester': 'North West England', 'Chorley': 'North West England',
    'Copeland': 'North West England', 'Cumbria': 'North West England', 'Eden': 'North West England',
    'Fylde': 'North West England', 'Greater Manchester': 'North West England', 'Halton': 'North West England',
    'Hyndburn': 'North West England', 'Knowsley': 'North West England', 'Lancashire': 'North West England',
    'Lancaster': 'North West England', 'Liverpool': 'North West England', 'Manchester': 'North West England',
    'Merseyside': 'North West England', 'Oldham': 'North West England', 'Pendle': 'North West England',
    'Preston': 'North West England', 'Ribble Valley': 'North West England', 'Rochdale': 'North West England',
    'Rossendale': 'North West England', 'Salford': 'North West England', 'Sefton': 'North West England',
    'South Lakeland': 'North West England', 'South Ribble': 'North West England', 'St Helens': 'North West England',
    'St. Helens': 'North West England', 'Stockport': 'North West England', 'Tameside': 'North West England',
    'Trafford': 'North West England', 'Warrington': 'North West England', 'West Lancashire': 'North West England',
    'Wigan': 'North West England', 'Wirral': 'North West England', 'Wyre': 'North West England',
    'Antrim': 'Northern Ireland', 'Ards': 'Northern Ireland', 'Armagh': 'Northern Ireland',
    'Ballymena': 'Northern Ireland', 'Ballymoney': 'Northern Ireland', 'Banbridge': 'Northern Ireland',
    'Belfast': 'Northern Ireland', 'Carrickfergus': 'Northern Ireland', 'Castlereagh': 'Northern Ireland',
    'Coleraine': 'Northern Ireland', 'Cookstown': 'Northern Ireland', 'County Armagh': 'Northern Ireland',
    'County Fermanagh': 'Northern Ireland', 'Craigavon': 'Northern Ireland', 'Derry': 'Northern Ireland',
    'Down': 'Northern Ireland', 'Dungannon': 'Northern Ireland', 'Fermanagh': 'Northern Ireland',
    'Larne': 'Northern Ireland', 'Limavady': 'Northern Ireland', 'Lisburn': 'Northern Ireland',
    'Magherafelt': 'Northern Ireland', 'Moyle': 'Northern Ireland', 'Newry and Mourne': 'Northern Ireland',
    'Newtownabbey': 'Northern Ireland', 'North Down': 'Northern Ireland', 'Omagh': 'Northern Ireland',
    'South Tyrone': 'Northern Ireland', 'Strabane': 'Northern Ireland', 'Aberdeen City': 'Scotland',
    'Aberdeenshire': 'Scotland', 'Angus': 'Scotland', 'Argyll and Bute': 'Scotland', 'Argyllshire': 'Scotland',
    'Ayrshire': 'Scotland', 'Banffshire': 'Scotland', 'Berwickshire': 'Scotland', 'Bute': 'Scotland',
    'Caithness': 'Scotland', 'City of Edinburgh': 'Scotland', 'Clackmannanshire': 'Scotland',
    'Dumfries and Galloway': 'Scotland', 'Dumfriesshire': 'Scotland', 'Dunbartonshire': 'Scotland',
    'Dundee City': 'Scotland', 'East Ayrshire': 'Scotland', 'East Dunbartonshire': 'Scotland',
    'East Lothian': 'Scotland', 'East Renfrewshire': 'Scotland', 'Edinburgh City': 'Scotland',
    'Eilean Siar': 'Scotland', 'Falkirk': 'Scotland', 'Fife': 'Scotland', 'Glasgow City': 'Scotland',
    'Highland': 'Scotland', 'Inverclyde': 'Scotland', 'Inverness-shire': 'Scotland', 'Kincardineshire': 'Scotland',
    'Kinross-shire': 'Scotland', 'Kirkcudbrightshire': 'Scotland', 'Lanarkshire': 'Scotland', 'Midlothian': 'Scotland',
    'Moray': 'Scotland', 'Nairnshire': 'Scotland', 'North Ayrshire': 'Scotland', 'North Lanarkshire': 'Scotland',
    'Orkney': 'Scotland', 'Orkney Islands': 'Scotland', 'Peeblesshire': 'Scotland', 'Perth and Kinross': 'Scotland',
    'Perthshire': 'Scotland', 'Renfrewshire': 'Scotland', 'Ross and Cromarty': 'Scotland', 'Roxburghshire': 'Scotland',
    'Selkirkshire': 'Scotland', 'Shetland Islands': 'Scotland', 'South Ayrshire': 'Scotland',
    'South Lanarkshire': 'Scotland', 'Stirling': 'Scotland', 'Stirlingshire': 'Scotland', 'Sutherland': 'Scotland',
    'The Scottish Borders': 'Scotland', 'West Ayrshire': 'Scotland', 'West Dunbartonshire': 'Scotland',
    'West Lothian': 'Scotland', 'Wigtownshire': 'Scotland', 'Zetland': 'Scotland', 'Adur': 'South East England',
    'Arun': 'South East England', 'Ashford': 'South East England', 'Aylesbury Vale': 'South East England',
    'Basingstoke and Deane': 'South East England', 'Berkshire': 'South East England',
    'Bracknell Forest': 'South East England', 'Brighton and Hove': 'South East England',
    'Buckinghamshire': 'South East England', 'Canterbury': 'South East England', 'Cherwell': 'South East England',
    'Chichester': 'South East England', 'Chiltern': 'South East England', 'Crawley': 'South East England',
    'Dartford': 'South East England', 'Dover': 'South East England', 'East Hampshire': 'South East England',
    'East Sussex': 'South East England', 'Eastbourne': 'South East England', 'Eastleigh': 'South East England',
    'Elmbridge': 'South East England', 'Epsom and Ewell': 'South East England', 'Fareham': 'South East England',
    'Gosport': 'South East England', 'Gravesham': 'South East England', 'Guildford': 'South East England',
    'Hampshire': 'South East England', 'Hart': 'South East England', 'Hastings': 'South East England',
    'Havant': 'South East England', 'Horsham': 'South East England', 'Isle of Wight': 'South East England',
    'Kent': 'South East England', 'Lewes': 'South East England', 'Maidstone': 'South East England',
    'Medway': 'South East England', 'Mid Sussex': 'South East England', 'Milton Keynes': 'South East England',
    'Mole Valley': 'South East England', 'New Forest': 'South East England', 'Oxford': 'South East England',
    'Oxfordshire': 'South East England', 'Portsmouth': 'South East England', 'Reading': 'South East England',
    'Reigate and Banstead': 'South East England', 'Rother': 'South East England', 'Runnymede': 'South East England',
    'Rushmoor': 'South East England', 'Sevenoaks': 'South East England', 'Shepway': 'South East England',
    'Slough': 'South East England', 'South Bucks': 'South East England', 'South Oxfordshire': 'South East England',
    'Southampton': 'South East England', 'Spelthorne': 'South East England', 'Surrey': 'South East England',
    'Surrey Heath': 'South East England', 'Swale': 'South East England', 'Tandridge': 'South East England',
    'Test Valley': 'South East England', 'Thanet': 'South East England', 'Tonbridge and Malling': 'South East England',
    'Tunbridge Wells': 'South East England', 'Vale of White Horse': 'South East England',
    'Waverley': 'South East England', 'Wealden': 'South East England', 'West Berkshire': 'South East England',
    'West Oxfordshire': 'South East England', 'West Sussex': 'South East England', 'Winchester': 'South East England',
    'Windsor and Maidenhead': 'South East England', 'Woking': 'South East England', 'Wokingham': 'South East England',
    'Worthing': 'South East England', 'Wycombe': 'South East England',
    'Bath and North East Somerset': 'South West England',
    'Bournemouth': 'South West England',
    'Bournemouth, Christchurch and Poole': 'South West England',
    'Bristol': 'South West England',
    'Cheltenham': 'South West England', 'Christchurch': 'South West England',
    'City of Bristol': 'South West England',
    'Bristol, City of': 'South West England',
    'Cornwall': 'South West England', 'Cotswold': 'South West England',
    'Devon': 'South West England', 'Dorset': 'South West England', 'East Devon': 'South West England',
    'East Dorset': 'South West England', 'Exeter': 'South West England', 'Forest of Dean': 'South West England',
    'Gloucester': 'South West England', 'Gloucestershire': 'South West England',
    'Isles of Scilly': 'South West England', 'Mendip': 'South West England', 'Mid Devon': 'South West England',
    'North Devon': 'South West England', 'North Dorset': 'South West England', 'North Somerset': 'South West England',
    'Plymouth': 'South West England', 'Poole': 'South West England', 'Purbeck': 'South West England',
    'Sedgemoor': 'South West England', 'Somerset': 'South West England', 'South Gloucestershire': 'South West England',
    'South Hams': 'South West England', 'South Somerset': 'South West England', 'Stroud': 'South West England',
    'Swindon': 'South West England', 'Taunton Deane': 'South West England', 'Teignbridge': 'South West England',
    'Tewkesbury': 'South West England', 'Torbay': 'South West England', 'Torridge': 'South West England',
    'West Devon': 'South West England', 'West Dorset': 'South West England', 'West Somerset': 'South West England',
    'Weymouth and Portland': 'South West England', 'Wiltshire': 'South West England', 'Aberdare': 'Wales',
    'Bargoed': 'Wales', 'Barry': 'Wales', 'Blaenau Gwent': 'Wales', 'Bridgend': 'Wales', 'Caerphilly': 'Wales',
    'Cardiff': 'Wales', 'Carmarthenshire': 'Wales', 'Ceredigion': 'Wales', 'Conwy': 'Wales', 'Cowbridge': 'Wales',
    'Denbighshire': 'Wales', 'Dinas Powys': 'Wales', 'Ferndale': 'Wales', 'Flintshire': 'Wales', 'Gwynedd': 'Wales',
    'Hengoed': 'Wales', 'Isle of Anglesey': 'Wales', 'Llantwit Major': 'Wales', 'Maesteg': 'Wales',
    'Merthyr Tydfil': 'Wales', 'Monmouthshire': 'Wales', 'Mountain Ash': 'Wales', 'Neath Port Talbot': 'Wales',
    'Newport': 'Wales', 'Pembrokeshire': 'Wales', 'Penarth': 'Wales', 'Pentre': 'Wales', 'Pontyclun': 'Wales',
    'Pontypridd': 'Wales', 'Porth': 'Wales', 'Porthcawl': 'Wales', 'Powys': 'Wales', 'Rhondda Cynon Taff': 'Wales',
    'Rhoose': 'Wales', 'Sully': 'Wales', 'Swansea': 'Wales',
    'The Vale of Glamorgan': 'Wales',
    'Vale of Glamorgan': 'Wales',
    'Tonypandy': 'Wales',
    'Torfaen': 'Wales', 'Treharris': 'Wales', 'Treorchy': 'Wales', 'Wrexham': 'Wales', 'Birmingham': 'West Midlands',
    'Bromsgrove': 'West Midlands', 'Cannock Chase': 'West Midlands', 'Coventry': 'West Midlands',
    'Dudley': 'West Midlands', 'East Staffordshire': 'West Midlands', 'Herefordshire': 'West Midlands',
    'Lichfield': 'West Midlands', 'Malvern Hills': 'West Midlands', 'Newcastle-under-Lyme': 'West Midlands',
    'North Warwickshire': 'West Midlands', 'Nuneaton and Bedworth': 'West Midlands', 'Redditch': 'West Midlands',
    'Rugby': 'West Midlands', 'Sandwell': 'West Midlands', 'Shropshire': 'West Midlands', 'Solihull': 'West Midlands',
    'South Staffordshire': 'West Midlands', 'Stafford': 'West Midlands', 'Staffordshire': 'West Midlands',
    'Staffordshire Moorlands': 'West Midlands', 'Stoke-on-Trent': 'West Midlands', 'Stratford-on-Avon': 'West Midlands',
    'Tamworth': 'West Midlands', 'Telford and Wrekin': 'West Midlands', 'Walsall': 'West Midlands',
    'Warwick': 'West Midlands', 'Warwickshire': 'West Midlands', 'West Midlands': 'West Midlands',
    'Wolverhampton': 'West Midlands', 'Worcester': 'West Midlands', 'Worcestershire': 'West Midlands',
    'Wychavon': 'West Midlands', 'Wyre Forest': 'West Midlands', 'Barnsley': 'Yorkshire and the Humber',
    'Bradford': 'Yorkshire and the Humber', 'Calderdale': 'Yorkshire and the Humber',
    'City of Kingston-upon-Hull': 'Yorkshire and the Humber', 'Craven': 'Yorkshire and the Humber',
    'Doncaster': 'Yorkshire and the Humber', 'East Riding of Yorkshire': 'Yorkshire and the Humber',
    'Hambleton': 'Yorkshire and the Humber', 'Harrogate': 'Yorkshire and the Humber',
    'Kingston upon Hull': 'Yorkshire and the Humber', 'Kirklees': 'Yorkshire and the Humber',
    'Leeds': 'Yorkshire and the Humber', 'North East Lincolnshire': 'Yorkshire and the Humber',
    'North Lincolnshire': 'Yorkshire and the Humber', 'Richmondshire': 'Yorkshire and the Humber',
    'Rotherham': 'Yorkshire and the Humber', 'Ryedale': 'Yorkshire and the Humber',
    'Scarborough': 'Yorkshire and the Humber', 'Selby': 'Yorkshire and the Humber',
    'Sheffield': 'Yorkshire and the Humber', 'South Yorkshire': 'Yorkshire and the Humber',
    'Wakefield': 'Yorkshire and the Humber', 'West Yorkshire': 'Yorkshire and the Humber',
    'York': 'Yorkshire and the Humber',
    'Westmorland': 'North West England',
    'Westmorland and Furness': 'North West England',

    # Additional mappings requried, based on what we find in the EPC database
    'Greater London Authority': 'Inner London',
    'Herefordshire, County of': 'West Midlands',
    "North Northamptonshire": 'East Midlands',
    "West Northamptonshire": 'East Midlands',
    # We have a bunch of inner London local authority mappings, which can be used if the county is not found
    'Barking and Dagenham': 'Inner London', 'Barnet': 'Inner London', 'Bexley': 'Inner London',
    'Brent': 'Inner London', 'Bromley': 'Inner London', 'Camden': 'Inner London', 'City of London': 'Inner London',
    'City of Westminster': 'Inner London', 'Croydon': 'Inner London', 'Ealing': 'Inner London',
    'Enfield': 'Inner London',
    'Greater London': 'Inner London', 'Greenwich': 'Inner London', 'Hackney': 'Inner London',
    'Hammersmith and Fulham': 'Inner London',
    'Haringey': 'Inner London', 'Harrow': 'Inner London', 'Havering': 'Inner London', 'Hillingdon': 'Inner London',
    'Hounslow': 'Inner London',
    'Islington': 'Inner London', 'Kensington and Chelsea': 'Inner London', 'Kingston upon Thames': 'Inner London',
    'Lambeth': 'Inner London',
    'Lewisham': 'Inner London', 'Merton': 'Inner London', 'Newham': 'Inner London', 'Redbridge': 'Inner London',
    'Richmond': 'Inner London',
    'Southwark': 'Inner London', 'Sutton': 'Inner London', 'Tower Hamlets': 'Inner London',
    'Waltham Forest': 'Inner London',
    'Wandsworth': 'Inner London', 'Westminster': 'Inner London',
    'Richmond upon Thames': 'Outer London',
}
