Skip to content

Instantly share code, notes, and snippets.

Andy Lulham andylolz

Block or report user

Report or block andylolz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andylolz
andylolz / active_v1_data.ipynb
Created May 15, 2019
Some stats on v1.0x data, using iatikit. Stats generated 15 May 2019.
View active_v1_data.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andylolz
andylolz / .block
Last active May 21, 2019 — forked from mbostock/.block
IATI traceability
View .block
license: gpl-3.0
View errors
8 3ie 3ie-artw http://www.3ieimpact.org/media/filer_public/2018/05/14/artw.xml
8 3ie 3ie-dpw http://www.3ieimpact.org/media/filer_public/2018/04/13/unflattened.xml
8 3ie 3ie-htw http://www.3ieimpact.org/media/filer_public/2018/05/14/hatw.xml
8 3ie 3ie-sptw http://www.3ieimpact.org/media/filer_public/2018/05/14/sptw.xml
8 3ie 3ie-taw http://www.3ieimpact.org/media/filer_public/2018/05/14/tai.xml
8 3ie 3ie-upw http://www.3ieimpact.org/media/filer_public/2018/05/14/upw.xml
8 aics aics-089 http://openaid.aics.gov.it/iati/aics-089.xml
8 ausgov ausgov-389 http://dfat.gov.au/data/downloads/Australian_Aid_Regional_File_North_and_Central_America_Unspecified.xml
8 ausgov ausgov-189 http://dfat.gov.au/data/downloads/Australian_Aid_Regional_File_North_of_Sahara.xml
8 caid_ireland caid_ireland-01 https://www.christianaid.ie/iati/CA-Ireland-Irish-Aid-Activity.xml
View output.csv
We can't make this file beautiful and searchable because it's too large.
timestamp,action,url,person,comment
"Nov. 28, 2014, 3:36 p.m.",person-update,,,Did a bit of googling.
"Dec. 7, 2014, 4:46 p.m.",candidacy-create,/person/3511,David Chappell,http://davidchappell.org.uk/en/
"Dec. 7, 2014, 4:50 p.m.",person-update,/person/3511,David Chappell,http://davidchappell.org.uk
"Jan. 15, 2015, 11:30 p.m.",person-update,/person/802,Anthony Ridge-Newman,http://ridgenewman.blogspot.co.uk
"Jan. 15, 2015, 11:49 p.m.",person-update,,,Standing in Shrewsbury and Atcham instead: https://shrewsburylibdems.wordpress.com/christine-tinker/
"Jan. 15, 2015, 11:56 p.m.",person-update,/person/2217,Andrew Illsley,http://alittlebitofstone.com/2015/01/15/ukip-selects-candidate-for-general-election/
"Jan. 16, 2015, 12:20 a.m.",person-update,,,https://shrewsburylibdems.wordpress.com/christine-tinker/
"Jan. 16, 2015, 12:26 a.m.",person-update,/person/1050,Christopher Warleigh-Lack,twitter.com
"Jan. 16, 2015, 12:37 a.m.",person-update,/person/2148,Emma Reynolds,http://news.bbc.co.uk/democracylive/hi/representat
View how-to-generate-a-nice-diff.md

Generating a nice diff of the changes in the v2.03 upgrade

First, fork this repo: https://github.com/IATI/IATI-Schemas

Then, do the following:

# clone version-2.02 branch to v2.03
git clone https://github.com/[your-username]/IATI-Schemas -b version-2.02 IATI-Schemas-v2.03
@andylolz
andylolz / results-2015-augmented.csv
Created Apr 20, 2017
GE2015 results, including Democracy Club ID (dc_id)
View results-2015-augmented.csv
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,
View output.txt
[This page intentionally left blank]
View calc.py
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 Dec 3, 2015
How many candidates are standing in UK elections in 2016?
View 2016_numbers.md

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 Apr 21, 2015
Westminster constituency data, including example postcodes
View gist:e1cbf97e996910e524be
{
"65642": {
"codes": {
"gss": "E14000847",
"unit_id": "24722"
},
"name": "North Herefordshire",
"country": "E",
"type_name": "UK Parliament constituency",
"example_postcode": "HR7 4LX",
You can’t perform that action at this time.