@@ -0,0 +1,1469 @@
+from data_collection.management.commands import BaseShpStationsShpDistrictsImporter%0A%0Aclass Command(BaseShpStationsShpDistrictsImporter):%0A    council_id = 'E07000098'%0A    srid = 27700%0A    districts_srid = 27700%0A    districts_name = 'PollingDistricts'%0A    stations_name = 'PollingStations.shp'%0A    elections = %5B'local.hertfordshire.2017-05-04'%5D%0A%0A    def district_record_to_dict(self, record):%0A        return %7B%0A            'internal_council_id': str(record%5B0%5D).strip(),%0A            'name': str(record%5B1%5D).strip(),%0A            'polling_station_id': str(record%5B0%5D).strip(),%0A        %7D%0A%0A    def format_address(self, record):%0A        address_parts = %5Bstr(record%5Bx%5D).strip() for x in range(3, 7)%5D%0A        for i, part in enumerate(address_parts):%0A            if part%5B:2%5D == %22b'%22:%0A                address_parts%5Bi%5D = ''%0A        for i, part in enumerate(address_parts):%0A            if len(part) %3C= 3 and len(part) %3E 0:%0A                address_parts%5Bi+1%5D = part + ' ' + address_parts%5Bi+1%5D%0A                address_parts%5Bi%5D = ''%0A                break%0A        address = %22%5Cn%22.join(address_parts)%0A        while %22%5Cn%5Cn%22 in address:%0A            address = address.replace(%22%5Cn%5Cn%22, %22%5Cn%22)%0A        return address.strip()%0A%0A    def station_record_to_dict(self, record):%0A        postcode = str(record%5B8%5D).strip('%5C'b').strip()%0A        return %7B%0A            'internal_council_id': str(record%5B1%5D).strip(),%0A            'address' : self.format_address(record),%0A            'postcode': postcode,%0A        %7D%0A

add import script for Hertsmere