Skip to content

Instantly share code, notes, and snippets.

@philipjohn
Created May 25, 2014 18:34
Show Gist options
  • Save philipjohn/165b9bb41fd129850bb5 to your computer and use it in GitHub Desktop.
Save philipjohn/165b9bb41fd129850bb5 to your computer and use it in GitHub Desktop.
Blog post about candidates collab thing wotsit

Collaborating on European Election data in GitHub

On Friday my friend and cracking coder Stuart Harrison, of the Open Data Institute, launched a collaborative project to collate European Parliament 2014 election results for the UK regions using GitHub. As I type I'm waiting for the start of results night so I can help with that project.

Inspired, I spent some of today building something similar to build a list of candidates for the UK General Election in 2015. Through a recent work project I've realised there isn't really a good data source for candidates, and the method Stuart devised for the European election results seemed like a great fit.

Contribute!

You can help build this with me, and all you really need to know is how to create and edit CSV files. I've split the following instructions into developer and non-developer guides to give each a more easy-to-follow set.

Non-Developers

  1. If you don't have one, sign up for a GitHub account (it's okay, it's not so scary)
  2. Create your own copy of the project by forking the repository
  3. Once that's done, you'll see the project and near the top a green button, with a grey button next to it that reads branch: master - click on that and type a name for your changes (e.g. it might be the name of the constituency you want to contribute candidates to).
  4. Click on Create branch: [your-name]
  5. Now click on the candidates folder
  6. If there is already a CSV file for the constituency you want to contribute to, skip ahead to 14
  7. Find and click on the example-candidates.csv file
  8. Click on the Raw link at the top-right
  9. Select all and copy
  10. Go back to the candidates folder
  11. Above the list of files, click on the plus (+) icon
  12. Use the constituency name as the file name, using all lower case and replacing spaces with hyphens. Check the full list of constituencies.
  13. Paste into this new file the example you copied earlier
  14. Add each candidate on a new line, using the headings on the first line as a guide to the order.
  15. Use the full list of parties for the Party name and ID columns.
  16. Once you're finished, return your cursor to the filename field at the top and hit enter. You'll be taken to the list of files again.
  17. At the top, click on ge2015-candidates to return to the top of the project
  18. You should now see a big green button that says "Compare & pull request". Click it.
  19. Enter a brief description of what you've modified and click "Send pull request"
  20. That's it! An automated script will check if your edits are in the right format. If we're happy, we'll merge those changes in. Thanks!

Developers

  1. Fork the repository
  2. Create a new branch for your changes
  3. Using the example, make your edits and/or additions
  4. Optionally install CID using gem install cid and run then run cid validate to check your formatting is correct
  5. Push your changes and create a pull request
  6. Travis will run your changes through CID and if all is okay, we should be able to merge. Thanks!

Then what?

Given a list of candidates cool things should be possible. I expect we'll need to add other info to the candidates data, like website, Twitter handle, Facebook page and so on. Other developers can then use that data to more easily create cool applications, like Democracy Club's own questionnaires project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment