Skip to content

Instantly share code, notes, and snippets.

@symroe
symroe / CircleCI-context-audit.py
Created January 5, 2023 10:23
Dumps all the context keys to a TSV on STDOUT
"""
Use:
Pass CIRCLECI_TOKEN and CIRCLECI_ORG_ID in as environment vars.
CIRCLECI_TOKEN is a personal access token from https://app.circleci.com/settings/user/tokens
CIRCLECI_ORG_ID is the Organisation ID from your CircleCI Organization Settings
Run the file and it'll output a TSV for you.
URL Name Ballot
https://candidates.democracyclub.org.uk/person/94007 Aamir Haroon local.sutton.sutton-north.2022-05-05
https://candidates.democracyclub.org.uk/person/95079 Aarti Joshi local.camden.belsize.2022-05-05
https://candidates.democracyclub.org.uk/person/91889 Abdul Bari local.birmingham.sparkbrook-balsall-heath-east.2022-05-05
https://candidates.democracyclub.org.uk/person/41823 Abdul Khalique local.birmingham.newtown.2022-05-05
https://candidates.democracyclub.org.uk/person/46266 Abdul Latif local.merton.merton-park.2022-05-05
https://candidates.democracyclub.org.uk/person/91581 Abid Khan local.birmingham.moseley.2022-05-05
https://candidates.democracyclub.org.uk/person/86441 Abu Kalam Azad Sarker local.ealing.northolt-west-end.2022-05-05
https://candidates.democracyclub.org.uk/person/38095 Ada Emeka Echedom local.barking-and-dagenham.abbey.2022-05-05
https://candidates.democracyclub.org.uk/person/10007 Adam Andrew Higgs local.birmingham.highters-heath.2022-05-05
doncaster.gov.uk/services/the-council-democracy/local-elections-2021
http://committeedmz.dartford.gov.uk/mgElectionAreaResults.aspx?ID=295&RPID=43255493
http://councillors.liverpool.gov.uk/mgElectionElectionAreaResults.aspx?Page=all&EID=55
http://democracy.stockport.gov.uk/mgElectionElectionAreaResults.aspx?Page=all&EID=53
http://moderngov.staffordshire.gov.uk/mgElectionAreaResults.aspx?XXR=0&ID=405&RPID=112608223
http://moderngov.staffordshire.gov.uk/mgElectionAreaResults.aspx?XXR=0&ID=406&RPID=112608223
http://moderngov.staffordshire.gov.uk/mgElectionAreaResults.aspx?XXR=0&ID=408&RPID=112608223
http://moderngov.staffordshire.gov.uk/mgElectionAreaResults.aspx?XXR=0&ID=409&RPID=112608223
http://moderngov.staffordshire.gov.uk/mgElectionAreaResults.aspx?XXR=0&ID=410&RPID=112608223
http://moderngov.staffordshire.gov.uk/mgElectionElectionAreaResults.aspx?Page=all&EID=31
import random
prefixes = {
"Saws",
"Woodset",
"Cocker",
"Stubbing",
"Hubbers",
"Westle",
"Bar",
DC_ID GSS BBC Name BBC Party DC Name DC Party
parl.wakefield.2019-12-12 E14001009 Imran Ahmad-Khan Conservative Imran Nasir Ahmad-Khan Conservative and Unionist Party
parl.wakefield.2019-12-12 E14001009 Mary Creagh Labour Mary Creagh Labour Party
parl.wakefield.2019-12-12 E14001009 Ryan Kett The Yorkshire Party Ryan Kett Yorkshire Party
parl.wakefield.2019-12-12 E14001009 Jamie Needle Liberal Democrat Jamie Needle Liberal Democrats
parl.wakefield.2019-12-12 E14001009 Stephen Whyte Independent Stephen Whyte Independent
parl.wakefield.2019-12-12 E14001009 Peter Wiltshire The Brexit Party Peter David Wiltshire The Brexit Party
parl.rutland-and-melton.2019-12-12 E14000909 Alicia Kearns Conservative Alicia Kearns Conservative and Unionist Party
parl.rutland-and-melton.2019-12-12 E14000909 Marietta King UK Independence Party Marletta King UK Independence Party (UKIP)
parl.rutland-and-melton.2019-12-12 E14000909 Alastair McQuillan Green Alastair McQuillan Green Party
EC_ID YNR_ID
PP428 party:428
PP264 party:264
PP263 party:263
PP429 party:429
PP719 party:719
PP307 party:307
PP2533 party:2533
PP210 party:210
PP2119 party:2119
YNR ID Name Twitter Wikidata ID Ballot elected
765 John Whittingdale JWhittingdale Q264684 parl.maldon.2017-06-08
6049 Peter Grant PeterGrantMP Q19882721 parl.glenrothes.2017-06-08
2567 Diane Abbott HackneyAbbott Q153454 parl.hackney-north-and-stoke-newington.2017-06-08
919 David Crausby DavidCrausby Q291441 parl.bolton-north-east.2017-06-08
34491 Neil O'Brien NeilDotObrien Q6989101 parl.harborough.2017-06-08
191 Derek Thomas DerekThomasUK Q20177497 parl.st-ives.2017-06-08
2625 John Stevenson JohnStevensonMP Q341538 parl.carlisle.2017-06-08
5921 Alan Brown AlanBrownSNP Q4706257 parl.kilmarnock-and-loudoun.2017-06-08
4499 Christine Jardine cajardineMP Q30164696 parl.edinburgh-west.2017-06-08
import requests
import csv
import sys
populaton_url = "https://petitionmap.unboxedconsulting.com/json/mps/population_ons.json"
req = requests.get(populaton_url)
POULATION_BY_GSS = req.json()
<!DOCTYPE html>
<html>
<head>
<style>
.box {
width:50%;
}
.box:nth-child(even) {
float:right;
<style>
.democracy_club_embed{font-size:19px;color:#58595b}.democracy_club_embed .card{border-radius:0 3px;clear:both;padding:20px;background:#fff;box-shadow:0 4px 8px 0 rgba(0,0,0,0.1),0 3px 10px 0 rgba(0,0,0,0.09)}.democracy_club_embed .dc_logo{text-decoration:none;font-size:14px}.democracy_club_embed .dc_logo img{max-width:120px;vertical-align:middle}.democracy_club_embed button{background-color:#00AEEF;border:0;padding:0.4em 0.6em;margin:0.5em 0;font-size:1em;color:#FFF;border-bottom:3px solid #0089bc}.democracy_club_embed button:hover{background-color:#009bd6}.democracy_club_embed .link-button{display:inline-block;border:2px solid #00AEEF;color:#00AEEF;font-size:1rem;font-family:Avenir,sans-serif;margin:0;padding:1rem 2rem 1.0625rem 2rem;text-decoration:none}.democracy_club_embed .link-button:hover{background-color:#f9fdff}.democracy_club_embed .form-group{width:100%;clear:both}.democracy_club_embed .form-control{font-size:19px;line-height:1.31;border:2px solid #0b0c0c;padding:5px 4px 4px}.democracy_