Skip to content

Commit

Permalink
Import script for Chelmsford (2024-12-12) (closes #8165)
Browse files Browse the repository at this point in the history
  • Loading branch information
polling-bot-4000 authored and awdem committed Nov 21, 2024
1 parent 68ebaa3 commit f1f2dc0
Showing 1 changed file with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,48 @@

class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "CHL"
addresses_name = "2024-07-04/2024-06-04T09:01:23.444439/CHL_combined.tsv"
stations_name = "2024-07-04/2024-06-04T09:01:23.444439/CHL_combined.tsv"
elections = ["2024-07-04"]
addresses_name = (
"2024-12-12/2024-11-20T15:03:43.866922/Democracy_Club__12December2024.tsv"
)
stations_name = (
"2024-12-12/2024-11-20T15:03:43.866922/Democracy_Club__12December2024.tsv"
)
elections = ["2024-12-12"]
csv_delimiter = "\t"

## Ignoring the warnings RE the following stations
## (Council has confirmed the current postcodes are correct):
## 'East Hanningfield Village Hall, The Tye, East Hanningfield, Chelmsford, CM3 8AE' (id: 13209)
## 'Civic Centre - Chelmsford City Council, Duke Street, Chelmsford, CM1 1JE' (id: 13420)
# Ignoring the warnings RE the following stations
# (Council has confirmed the current postcodes are correct):
# 'East Hanningfield Village Hall, The Tye, East Hanningfield, Chelmsford, CM3 8AE' (id: 13209)
# 'Civic Centre - Chelmsford City Council, Duke Street, Chelmsford, CM1 1JE' (id: 13420)

def address_record_to_dict(self, record):
uprn = record.property_urn.strip().lstrip("0")

if (
uprn
in [
"100091430409", # BARNES MILL HOUSE, MILL VUE ROAD, CHELMSFORD
"10093928503", # 67 BROOMFIELD ROAD, CHELMSFORD
"200004630041", # 1 LIBERTY WAY, RUNWELL, WICKFORD
"100091430409", # BASSMENT NIGHTCLUB, 16-18 WELLS STREET, CHELMSFORD
"200004630041", # NEW BUNGALOW, TURKEY FARM, WINDSOR ROAD, DOWNHAM, BILLERICAY
"10093928503", # HONEYSTONE, SOUTHEND ROAD, HOWE GREEN, CHELMSFORD
"200004627211", # BARNES MILL HOUSE, MILL VUE ROAD, CHELMSFORD
"10093928515", # CARAVAN 2 AT OAKVALE DOMSEY LANE, LITTLE WALTHAM, CHELMSFORD
]
):
return None

if record.addressline6 in [
# split
"CM1 7AR",
"CM1 1FU",
"CM3 1ER",
"CM4 9JL",
# removing addresses for NPR
if record.polling_place_id in [
"14153", # Danbury Chapel
"14039", # Danbury Leisure Centre
]:
return None

return super().address_record_to_dict(record)

def station_record_to_dict(self, record):
# removing stations for NPR
if record.polling_place_id in [
"14153", # Danbury Chapel
"14039", # Danbury Leisure Centre
]:
return None

return super().station_record_to_dict(record)

0 comments on commit f1f2dc0

Please sign in to comment.