Skip to content

Commit

Permalink
Import script for Rochdale (2024-02-29) (closes #6136)
Browse files Browse the repository at this point in the history
  • Loading branch information
polling-bot-4000 authored and awdem committed Feb 13, 2024
1 parent 0dc706c commit 599fb36
Showing 1 changed file with 20 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,44 @@
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "RCH"
addresses_name = (
"2023-05-04/2023-03-09T13:27:25.433057/Democracy_Club__04May2023.tsv"
"2024-02-29/2024-02-12T10:11:09.302381/Democracy_Club__29February2024 1.tsv"
)
stations_name = (
"2023-05-04/2023-03-09T13:27:25.433057/Democracy_Club__04May2023.tsv"
"2024-02-29/2024-02-12T10:11:09.302381/Democracy_Club__29February2024 1.tsv"
)
elections = ["2023-05-04"]
elections = ["2024-02-29"]
csv_encoding = "windows-1252"
csv_delimiter = "\t"

def station_record_to_dict(self, record):
# Polling station Room At Rear of St James Church -> Checked & OK

if record.polling_place_id in [
"4660", # Mobile Unit at The Black Dog Pub
"4728", # Mobile Unit at The Black Dog Pub
"4585", # Falinge Park Bowling Club
]:
record = record._replace(polling_place_postcode="")

return super().station_record_to_dict(record)

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

if uprn in [
"23050342", # 2 CHADWICK STREET, FIRGROVE, ROCHDALE
"10023363964", # 6 BELFIELD LANE, ROCHDALE
"23040672", # NADEN HOUSE, WOODHOUSE LANE, ROCHDALE
"10094362349", # 10 FRANCIS CLOSE, MIDDLETON, MANCHESTER
"10094361530", # APPLE VIEW 107 SHAW ROAD, ROCHDALE
"10094361529", # APPLE COTTAGE 105 SHAW ROAD, ROCHDALE
"23099722", # 12B MANCHESTER ROAD, HEYWOOD
"10094362473", # 1 POPPY CLOSE, LITTLEBOROUGH
]:
return None

if record.addressline6 in [
"OL10 1FH",
"OL10 3BJ",
if record.addressline6.replace("\xa0", " ") in [
# split
"CV10 9QF",
"OL16 1FD",
"OL15 9LY",
"OL15 0JH",
"OL11 3AE",
"M24 4FJ",
"M24 2PR",
"OL16 4XF",
"OL16 2SD",
"OL10 4DG",
"OL16 4XF",
"OL16 4RF",
"M24 6UE",
"M24 6DW",
"OL16 1FD",
"OL10 2JP",
"M24 1LG",
"OL10 3LW",
# suspicious
"OL12 6GP", # fails to remove: APARTMENT 18, 41 TOAD LANE, ROCHDALE
"OL12 9QA",
"OL12 6GR",
"OL12 0NU",
"OL11 2HF",
]:
return None # split
return None

return super().address_record_to_dict(record)

0 comments on commit 599fb36

Please sign in to comment.