Slightly Easier than Herding Cats.
- electionsni.org
- voteherder.com
- voteherder.org
- Elections (https://elections.democracyclub.org.uk/elections/nia.2022-05-05/)
- Includes geojson bounds https://elections.democracyclub.org.uk/elections/nia.belfast-east.2022-05-05/
- Also Candidates Data (https://candidates.democracyclub.org.uk/elections/nia.2022-05-05/)
- Linked from Elections data too
- somehow get a python base version, pyenv can be an option
- install python poetry
- run
poetry install
- run
poetry shell
# to get your shell into the correct virtualenv
python manage.py makemigrations counts
python manage.py migrate
python manage.py createsuperuser --username admin --email [email protected]
Previous Northern Ireland Elections covered by ElectionsNI
A management command is provided for importing existing election data into the data set.
This pulls in Election and Candidate data from elections.democracyclub.org.uk, and tries to match these with the Stage count data. There are currently two 'matching' heuristics in place for 'historical' election matching;
- Scan the DemocracyClub sourced list of Candidates for a given election/ballot and take the candidate who's name has
the highest
SequenceMatcher
ratio (as long as it's > 0.5) - Somehow, if that's not enough, check with DemocracyClub if the presented Candidate_ID has been rolled up/deduplicated
** THIS WILL DROP ALL BALLOTS/STAGE/STAGECELL DATA FOR THE SPECIFIED CONTEST **
python manage.py populate_nia_count nia.2017-03-02
For a lazy copy-paste job, here you go;
python manage.py populate_nia_count nia.2017-03-02
python manage.py populate_nia_count nia.2016-05-05
for a lazyer copy-paste job, here you go(or if you need to reset everything after running rm db.sqlite3
):
poetry run python manage.py flush
poetry run python manage.py makemigrations voteherder
poetry run python manage.py migrate
poetry run python manage.py createsuperuser --username admin --email [email protected]
poetry run python manage.py populate_nia_count nia.2017-03-02
poetry run python manage.py populate_nia_count nia.2016-05-05
poetry run python manage.py populate_nia_count nia.2022-05-05
2011 doesn't exist, see here
python manage.py runserver
Then go here to see a list of imported ballots, or here to drop into the swagger ui
Taken from DemocracyClub
Candidates are a mix of a person and a candidacy. A candidacy is the person on a ballot. Ballots have elections and divisions (areas, currently called posts).
A person can stand in more than one election, that is, they can have many candidacies on different ballots.
Ballots make up the main structure of the data, with each ballot being grouped by elections or divisions.