Voter registration information
This project does a number of things:
- Provides some scripts work manipulating and storying electoral registers
- Provides a web interface for exploring ward level aggregated stats for a postcode.
- Provides some tools for adding those stats to local images, designed for sharing.
- Place a register in
- Convert the register to a CSV file (if it isn't one already). The format can be TSV or CSV, but the file name needs to end with
Run the script
data/electoral_rolls/convert_to_csvs.shwith the folder name as the first argument:
sudo convert_to_csvs.sh E123-trumpton. Note that
sudois required, and
sofficeneeds to the on the
Alternatively find another way to convert the file to a CSV and save it alongside the register in the
In the 'web' folder, run
./manage.py clean_data_files. Do clean a single register, you can add
--gss E123as an argument. This will convert the CSV created in the previous step in to the format needed for the web system. It does the following:
Removes all data we're not interested in, like names and voter numbers.
Converts split address fields in to a single field.
Makes a postcode column from any column that looks like it might be a postcode
Ignores lines that don't look valid (mainly, without a postcode)
Import the file in to the database:
./manage.py import_cleaned_data. You can pass a
--gssargument to this command, as above.
Geocode the data:
Update the population data:
Once the steps in "Registers" above have been run, you need to add generated images to the new data: