Skip to content

Instantly share code, notes, and snippets.

View andylolz's full-sized avatar

Andy Lulham andylolz

View GitHub Profile
@andylolz
andylolz / results-2015-augmented.csv
Created April 20, 2017 22:37
GE2015 results, including Democracy Club ID (dc_id)
We can't make this file beautiful and searchable because it's too large.
dc_id,ons_id,ons_region_id,constituency_name,county_name,region_name,country_name,constituency_type,party_name,party_abbreviation,firstname,surname,gender,sitting_mp,former_mp,votes,share,change
4252,W07000049,W92000004,Aberavon,West Glamorgan,Wales,Wales,County,Labour,Lab,Stephen,Kinnock,Male,No,No,15416,0.489039749,-0.030147537
6754,W07000049,W92000004,Aberavon,West Glamorgan,Wales,Wales,County,UK Independence Party,UKIP,Peter,Bush,Male,No,No,4971,0.157694382,0.141898788
5518,W07000049,W92000004,Aberavon,West Glamorgan,Wales,Wales,County,Conservative,Con,Edward,Yi He,Male,No,No,3742,0.118706976,-0.023776389
5576,W07000049,W92000004,Aberavon,West Glamorgan,Wales,Wales,County,Plaid Cymru,PC,Duncan,Higgitt,Male,No,No,3663,0.116200869,0.045201451
4561,W07000049,W92000004,Aberavon,West Glamorgan,Wales,Wales,County,Liberal Democrat,LD,Helen,Clarke,Female,No,No,1397,0.044316848,-0.118290556
20,W07000049,W92000004,Aberavon,West Glamorgan,Wales,Wales,County,Independent,Ind,Captain,Beany,Male,No,No,1137,0.036068902,
[This page intentionally left blank]
@andylolz
andylolz / calc.py
Last active January 30, 2017 16:47
import csv
import requests
json = requests.get('https://petition.parliament.uk/petitions/171928.json').json()
petition = json['data']['attributes']['signatures_by_constituency']
with open('electorate.tsv') as f:
r = csv.DictReader(f, delimiter='\t')
constituencies = [x for x in r]
@andylolz
andylolz / 2016_numbers.md
Last active December 3, 2015 14:56
How many candidates are standing in UK elections in 2016?

2016 Elections – Candidate lists

One Democracy Club (DC) plan for 2016 is to create candidate lists for all 2016 UK elections (much like we did for the 2015 general election (GE2015) with https://yournextmp.com). Last night @ Citizen Beta (Cß), Mark Longair rightly flagged that this is quite (very) ambitious! I realised I have no handle on just how ambitious i.e. how many candidates we’re talking.

The Electoral Commission have a list of upcoming elections: http://www.electoralcommission.org.uk/find-information-by-subject/elections-and-referendums/upcoming-elections-and-referendums

Below are the numbers I’ve found so far for each.

Northern Ireland Assembly election

@andylolz
andylolz / gist:e1cbf97e996910e524be
Created April 21, 2015 16:52
Westminster constituency data, including example postcodes
{
"65642": {
"codes": {
"gss": "E14000847",
"unit_id": "24722"
},
"name": "North Herefordshire",
"country": "E",
"type_name": "UK Parliament constituency",
"example_postcode": "HR7 4LX",
@andylolz
andylolz / gist:976690ee36f081b1f504
Created April 10, 2015 09:39
Have submitted CVs
1930-06-21 Gerald Kaufman
1933-06-26 David Winnick
1943-08-20 Roger Gale
1944-09-08 Margaret Hodge
1945-11-14 Louise Ellman
1952-02-01 Andrew Smith
1952-03-22 David Jones
1952-04-04 Jim Fitzpatrick
1953-01-11 Graham Allen
1953-07-24 Julian Brazier

Keybase proof

I hereby claim:

  • I am andylolz on github.
  • I am andylolz (https://keybase.io/andylolz) on keybase.
  • I have a public key whose fingerprint is 8B21 BF74 E3E1 21AB 4D5D A33B 43A3 BB6E 4CB8 8509

To claim this, I am signing this object:

{
"NiaGriffithMP": 481120639,
"StewartHosieMP": 219298196,
"MichaelMcCannMP": 397229449,
"GWilliamsonMP": 368314502,
"JohnHowellMP": 993161678,
"tomgreatrexmp": 198912426,
"PatGlassMP": 118429508,
"NickBolesMP": 1548391070,
"jarrowstevemp": 2808847414,
#!/usr/bin/env python
import base64
import os
import sys
import webbrowser
import hashlib
import hmac
Party Selected Women % Women
Conservative 57 9 15.8%
Labour 58 16 27.6%
Lib Dems 54 14 25.9%
SNP 59 21 35.6%
Greens 31 13 41.9%