Created
January 5, 2016 20:58
-
-
Save jacksonj04/f7914ce2cfd7ada6f293 to your computer and use it in GitHub Desktop.
Generate Random Representatives List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# generate-reps-list.py | |
# | |
# A handy script for spitting out a randomly selected sample of representatives, chosen from multiple lists. | |
# | |
# Usage: ./generate-reps-list.py 100 output.csv | |
# | |
# Copright 2016 UK Citizens Online Democracy | |
import random, sys | |
script, targetcount, outfile = sys.argv | |
targetcount = int(targetcount) | |
groups = ( | |
{ | |
'name': 'Scottish Parliament', | |
'members': [ | |
'George Adam', | |
'Clare Adamson', | |
'Alasdair Allan', | |
'Christian Allard', | |
'Jackie Baillie', | |
'Claire Baker', | |
'Richard Baker', | |
'Jayne Baxter', | |
'Colin Beattie', | |
'Marco Biagi', | |
'Neil Bibby', | |
'Sarah Boyack', | |
'Chic Brodie', | |
'Gavin Brown', | |
'Keith Brown', | |
'Cameron Buchanan', | |
'Margaret Burgess', | |
'Aileen Campbell', | |
'Roderick Campbell', | |
'Jackson Carlaw', | |
'Malcolm Chisholm', | |
'Willie Coffey', | |
'Angela Constance', | |
'Bruce Crawford', | |
'Roseanna Cunningham', | |
'Ruth Davidson', | |
'Graeme Dey', | |
'Nigel Don', | |
'Bob Doris', | |
'James Dornan', | |
'Kezia Dugdale', | |
'Jim Eadie', | |
'Annabelle Ewing', | |
'Fergus Ewing', | |
'Linda Fabiani', | |
'Mary Fee', | |
'Patricia Ferguson', | |
'Alex Fergusson', | |
'Neil Findlay', | |
'John Finnie', | |
'Joe FitzPatrick', | |
'Murdo Fraser', | |
'Kenneth Gibson', | |
'Rob Gibson', | |
'Baroness Annabel MacNicoll Goldie', | |
'Christine Grahame', | |
'Rhoda Grant', | |
'Iain Gray', | |
'Mark Griffin', | |
'Claudia Hamilton Beamish', | |
'Patrick Harvie', | |
'Hugh Henry', | |
'Jamie Hepburn', | |
'Cara Hilton', | |
'Jim Hume', | |
'Fiona Hyslop', | |
'Adam Ingram', | |
'Alex Johnstone', | |
'Alison Johnstone', | |
'Colin Keir', | |
'James Kelly', | |
'Bill Kidd', | |
'Johann Lamont', | |
'John Lamont', | |
'Richard Lochhead', | |
'Richard Lyle', | |
'Kenny MacAskill', | |
'Angus MacDonald', | |
'Gordon MacDonald', | |
'Lewis Macdonald', | |
'Kenneth Macintosh', | |
'Derek Mackay', | |
'Mike MacKenzie', | |
'Hanzala Malik', | |
'Jenny Marra', | |
'Paul Martin', | |
'Tricia Marwick', | |
'John Mason', | |
'Michael Matheson', | |
'Stewart Maxwell', | |
'Joan McAlpine', | |
'Liam McArthur', | |
'Margaret McCulloch', | |
'Mark McDonald', | |
'Margaret McDougall', | |
'Jamie McGrigor', | |
'Alison McInnes', | |
'Christina McKelvie', | |
'Aileen McLeod', | |
'Fiona McLeod', | |
'Michael McMahon', | |
'Siobhan McMahon', | |
'Stuart McMillan', | |
'Duncan McNeil', | |
'Anne McTaggart', | |
'Nanette Milne', | |
'Margaret Mitchell', | |
'Elaine Murray', | |
'Alex Neil', | |
'Gil Paterson', | |
'Graeme Pearson', | |
'John Pentland', | |
'Willie Rennie', | |
'Dennis Robertson', | |
'Shona Robison', | |
'Alex Rowley', | |
'Michael Russell', | |
'Alex Salmond', | |
'Mary Scanlon', | |
'John Scott', | |
'Tavish Scott', | |
'Richard Simpson', | |
'Drew Smith', | |
'Elaine Smith', | |
'Elizabeth Smith', | |
'Stewart Stevenson', | |
'David Stewart', | |
'Kevin Stewart', | |
'Nicola Sturgeon', | |
'John Swinney', | |
'Dave Thompson', | |
'David Torrance', | |
'Jean Urquhart', | |
'Maureen Watt', | |
'Paul Wheelhouse', | |
'Sandra White', | |
'John Wilson', | |
'Humza Yousaf', | |
] | |
}, | |
{ | |
'name': 'Welsh Assembly', | |
'members': [ | |
'Leighton Andrews', | |
'Mick Antoniw', | |
'Rhun ap Iorwerth', | |
'Mohammad Asghar (Oscar)', | |
'Peter Black', | |
'Angela Burns', | |
'Dame Rosemary Butler', | |
'Christine Chapman', | |
'Jeff Cuthbert', | |
'Alun Davies', | |
'Andrew RT Davies', | |
'Jocelyn Davies', | |
'Keith Davies', | |
'Paul Davies', | |
'Suzy Davies', | |
'Mark Drakeford', | |
'Dafydd Elis-Thomas', | |
'Rebecca Evans', | |
'Janet Finch-Saunders', | |
'Russell George', | |
'Vaughan Gething', | |
'William Graham', | |
'Janice Gregory', | |
'John Griffiths', | |
'Lesley Griffiths', | |
'Llyr Gruffydd', | |
'Edwina Hart', | |
'Janet Haworth', | |
'Mike Hedges', | |
'Altaf Hussain', | |
'Jane Hutt', | |
'Mark Isherwood', | |
'Julie James', | |
'Bethan Jenkins', | |
'Alun Ffred Jones', | |
'Ann Jones', | |
'Carwyn Jones', | |
'Elin Jones', | |
'Huw Lewis', | |
'David Melding', | |
'Sandy Mewies', | |
'Darren Millar', | |
'Julie Morgan', | |
'Lynne Neagle', | |
'Eluned Parrott', | |
'William Powell', | |
'Gwyn R Price', | |
'Nick Ramsay', | |
'Jenny Rathbone', | |
'David Rees', | |
'Aled Roberts', | |
'Carl Sargeant', | |
'Ken Skates', | |
'Gwenda Thomas', | |
'Rhodri Glyn Thomas', | |
'Simon Thomas', | |
'Joyce Watson', | |
'Lindsay Whittle', | |
'Kirsty Williams', | |
'Leanne Wood', | |
] | |
}, | |
{ | |
'name': 'House of Commons', | |
'members': [ | |
'Diane Abbott', | |
'Debbie Abrahams', | |
'Nigel Adams', | |
'Adam Afriyie', | |
'Tasmina Ahmed-Sheikh', | |
'Peter Aldous', | |
'Heidi Alexander', | |
'Rushanara Ali', | |
'Lucy Allan', | |
'Graham Allen', | |
'Heidi Allen', | |
'David Amess', | |
'David Anderson', | |
'Stuart Andrew', | |
'Caroline Ansell', | |
'Edward Argar', | |
'Richard Arkless', | |
'Jon Ashworth', | |
'Victoria Atkins', | |
'Ian Austin', | |
'Richard Bacon', | |
'Adrian Bailey', | |
'Steven Baker', | |
'Harriett Baldwin', | |
'Stephen Barclay', | |
'Hannah Bardell', | |
'John Baron', | |
'Kevin Barron', | |
'Gavin Barwell', | |
'Guto Bebb', | |
'Margaret Beckett', | |
'Henry Bellingham', | |
'Hilary Benn', | |
'Richard Benyon', | |
'John Bercow', | |
'Paul Beresford', | |
'Luciana Berger', | |
'Jake Berry', | |
'James Berry', | |
'Clive Betts', | |
'Andrew Bingham', | |
'Mhairi Black', | |
'Ian Blackford', | |
'Bob Blackman', | |
'Kirsty Blackman', | |
'Roberta Blackman-Woods', | |
'Nicola Blackwood', | |
'Tom Blenkinsop', | |
'Paul Blomfield', | |
'Crispin Blunt', | |
'Nicholas Boles', | |
'Peter Bone', | |
'Victoria Borwick', | |
'Phil Boswell', | |
'Peter Bottomley', | |
'Karen Bradley', | |
'Ben Bradshaw', | |
'Graham Brady', | |
'Mickey Brady', | |
'Tom Brake', | |
'Julian Brazier', | |
'Kevin Brennan', | |
'Andrew Bridgen', | |
'Steve Brine', | |
'Deidre Brock', | |
'James Brokenshire', | |
'Alan Brown', | |
'Lyn Brown', | |
'Nick Brown', | |
'Fiona Bruce', | |
'Chris Bryant', | |
'Karen Buck', | |
'Robert Buckland', | |
'Richard Burden', | |
'Richard Burgon', | |
'Andy Burnham', | |
'Conor Burns', | |
'Simon Burns', | |
'David Burrowes', | |
'Alistair Burt', | |
'Dawn Butler', | |
'Liam Byrne', | |
'Ruth Cadbury', | |
'Alun Cairns', | |
'David Cameron', | |
'Lisa Cameron', | |
'Alan Campbell', | |
'Gregory Campbell', | |
'Ronnie Campbell', | |
'Alistair Carmichael', | |
'Neil Carmichael', | |
'Douglas Carswell', | |
'James Cartlidge', | |
'Bill Cash', | |
'Maria Caulfield', | |
'Alex Chalk', | |
'Sarah Champion', | |
'Douglas Chapman', | |
'Jenny Chapman', | |
'Joanna Cherry', | |
'Rehman Chishti', | |
'Christopher Chope', | |
'Jo Churchill', | |
'Greg Clark', | |
'Kenneth Clarke', | |
'Nick Clegg', | |
'James Cleverly', | |
'Geoffrey Clifton-Brown', | |
'Ann Clwyd', | |
'Vernon Coaker', | |
'Ann Coffey', | |
'Therese Coffey', | |
'Damian Collins', | |
'Oliver Colvile', | |
'Julie Cooper', | |
'Rosie Cooper', | |
'Yvette Cooper', | |
'Jeremy Corbyn', | |
'Alberto Costa', | |
'Ronnie Cowan', | |
'Geoffrey Cox', | |
'Jo Cox', | |
'Neil Coyle', | |
'Stephen Crabb', | |
'David Crausby', | |
'Angela Crawley', | |
'Mary Creagh', | |
'Stella Creasy', | |
'Tracey Crouch', | |
'Jon Cruddas', | |
'John Cryer', | |
'Judith Cummins', | |
'Alex Cunningham', | |
'Jim Cunningham', | |
'Nicholas Dakin', | |
'Simon Danczuk', | |
'Wayne David', | |
'Byron Davies', | |
'Chris Davies', | |
'David Davies', | |
'Geraint Davies', | |
'Glyn Davies', | |
'James Davies', | |
'Mims Davies', | |
'Philip Davies', | |
'David Davis', | |
'Martyn Day', | |
'Gloria De Piero', | |
'Thangam Debbonaire', | |
'Caroline Dinenage', | |
'Jonathan Djanogly', | |
'Martin Docherty', | |
'Nigel Dodds', | |
'Pat Doherty', | |
'Jeffrey M. Donaldson', | |
'Stuart Donaldson', | |
'Michelle Donelan', | |
'Nadine Dorries', | |
'Steve Double', | |
'Stephen Doughty', | |
'Jim Dowd', | |
'Peter Dowd', | |
'Oliver Dowden', | |
'Jackie Doyle-Price', | |
'Richard Drax', | |
'Jack Dromey', | |
'Flick Drummond', | |
'James Duddridge', | |
'Michael Dugher', | |
'Alan Duncan', | |
'Iain Duncan Smith', | |
'Philip Dunne', | |
'Mark Durkan', | |
'Angela Eagle', | |
'Maria Eagle', | |
'Jonathan Edwards', | |
'Clive Efford', | |
'Julie Elliott', | |
'Tom Elliott', | |
'Michael Ellis', | |
'Jane Ellison', | |
'Louise Ellman', | |
'Tobias Ellwood', | |
'Charlie Elphicke', | |
'Natascha Engel', | |
'Bill Esterson', | |
'George Eustice', | |
'Chris Evans', | |
'Graham Evans', | |
'Nigel Evans', | |
'David Evennett', | |
'Michael Fabricant', | |
'Michael Fallon', | |
'Paul Farrelly', | |
'Tim Farron', | |
'Marion Fellows', | |
'Suella Fernandes', | |
'Margaret Ferrier', | |
'Frank Field', | |
'Mark Field', | |
'Jim Fitzpatrick', | |
'Rob Flello', | |
'Colleen Fletcher', | |
'Caroline Flint', | |
'Paul Flynn', | |
'Kevin Foster', | |
'Yvonne Fovargue', | |
'Liam Fox', | |
'Vicky Foxcroft', | |
'Mark Francois', | |
'Lucy Frazer', | |
'George Freeman', | |
'Mike Freer', | |
'Richard Fuller', | |
'Marcus Fysh', | |
'Roger Gale', | |
'Mike Gapes', | |
'Barry Gardiner', | |
'Edward Garnier', | |
'Mark Garnier', | |
'David Gauke', | |
'Stephen Gethins', | |
'Nusrat Ghani', | |
'Nick Gibb', | |
'Patricia Gibson', | |
'Cheryl Gillan', | |
'Pat Glass', | |
'John Glen', | |
'Mary Glindon', | |
'Roger Godsiff', | |
'Zac Goldsmith', | |
'Helen Goodman', | |
'Robert Goodwill', | |
'Michael Gove', | |
'Patrick Grady', | |
'Richard Graham', | |
'Helen Grant', | |
'Peter Grant', | |
'James Gray', | |
'Neil Gray', | |
'Chris Grayling', | |
'Chris Green', | |
'Damian Green', | |
'Kate Green', | |
'Justine Greening', | |
'Lilian Greenwood', | |
'Margaret Greenwood', | |
'Dominic Grieve', | |
'Nia Griffith', | |
'Andrew Griffiths', | |
'Ben Gummer', | |
'Andrew Gwynne', | |
'Sam Gyimah', | |
'Louise Haigh', | |
'Robert Halfon', | |
'Luke Hall', | |
'Fabian Hamilton', | |
'Philip Hammond', | |
'Stephen Hammond', | |
'Matthew Hancock', | |
'Greg Hands', | |
'David Hanson', | |
'Harriet Harman', | |
'Mark Harper', | |
'Harry Harpham', | |
'Richard Harrington', | |
'Carolyn Harris', | |
'Rebecca Harris', | |
'Simon Hart', | |
'Alan Haselhurst', | |
'Helen Hayes', | |
'John Hayes', | |
'Sue Hayman', | |
'Oliver Heald', | |
'John Healey', | |
'James Heappey', | |
'Chris Heaton-Harris', | |
'Peter Heaton-Jones', | |
'Gordon Henderson', | |
'Mark Hendrick', | |
'Drew Hendry', | |
'Stephen Hepburn', | |
'Nick Herbert', | |
'Sylvia Hermon', | |
'Meg Hillier', | |
'Damian Hinds', | |
'Simon Hoare', | |
'Margaret Hodge', | |
'Sharon Hodgson', | |
'Kate Hoey', | |
'Kate Hollern', | |
'George Hollingbery', | |
'Kevin Hollinrake', | |
'Philip Hollobone', | |
'Adam Holloway', | |
'Kelvin Hopkins', | |
'Kris Hopkins', | |
'Stewart Hosie', | |
'George Howarth', | |
'Gerald Howarth', | |
'John Howell', | |
'Ben Howlett', | |
'Lindsay Hoyle', | |
'Nigel Huddleston', | |
'Jeremy Hunt', | |
'Tristram Hunt', | |
'Rupa Huq', | |
'Nick Hurd', | |
'Imran Hussain', | |
'Huw Irranca-Davies', | |
'Stewart Jackson', | |
'Margot James', | |
'Dan Jarvis', | |
'Sajid Javid', | |
'Ranil Jayawardena', | |
'Bernard Jenkin', | |
'Andrea Jenkyns', | |
'Robert Jenrick', | |
'Alan Johnson', | |
'Boris Johnson', | |
'Diana R. Johnson', | |
'Gareth Johnson', | |
'Jo Johnson', | |
'Andrew Jones', | |
'David Jones', | |
'Gerald Jones', | |
'Graham Jones', | |
'Helen Jones', | |
'Kevan Jones', | |
'Marcus Jones', | |
'Susan Elan Jones', | |
'Mike Kane', | |
'Gerald Kaufman', | |
'Daniel Kawczynski', | |
'Barbara Keeley', | |
'Liz Kendall', | |
'Seema Kennedy', | |
'George Kerevan', | |
'Calum Kerr', | |
'Sadiq Khan', | |
'Danny Kinahan', | |
'Stephen Kinnock', | |
'Simon Kirby', | |
'Greg Knight', | |
'Julian Knight', | |
'Kwasi Kwarteng', | |
'Peter Kyle', | |
'Eleanor Laing', | |
'Norman Lamb', | |
'David Lammy', | |
'Mark Lancaster', | |
'Pauline Latham', | |
'Ian Lavery', | |
'Chris Law', | |
'Andrea Leadsom', | |
'Phillip Lee', | |
'Jeremy Lefroy', | |
'Edward Leigh', | |
'Charlotte Leslie', | |
'Chris Leslie', | |
'Oliver Letwin', | |
'Emma Lewell-Buck', | |
'Brandon Lewis', | |
'Clive Lewis', | |
'Ivan Lewis', | |
'Julian Lewis', | |
'Ian Liddell-Grainger', | |
'David Lidington', | |
'Peter Lilley', | |
'Rebecca Long-Bailey', | |
'Jack Lopresti', | |
'Jonathan Lord', | |
'Tim Loughton', | |
'Caroline Lucas', | |
'Ian Lucas', | |
'Karen Lumley', | |
'Holly Lynch', | |
'Craig Mackinlay', | |
'David Mackintosh', | |
'Angus MacNeil', | |
'Fiona Mactaggart', | |
'Justin Madders', | |
'Khalid Mahmood', | |
'Shabana Mahmood', | |
'Anne Main', | |
'Alan Mak', | |
'Seema Malhotra', | |
'Kit Malthouse', | |
'John Mann', | |
'Scott Mann', | |
'Rob Marris', | |
'Gordon Marsden', | |
'Rachael Maskell', | |
'Paul Maskey', | |
'Chris Matheson', | |
'Tania Mathias', | |
'Theresa May', | |
'Paul Maynard', | |
'Steve McCabe', | |
'Callum McCaig', | |
'Kerry McCarthy', | |
'Jason McCartney', | |
'Karl McCartney', | |
'Siobhain McDonagh', | |
'Andy McDonald', | |
'Stewart McDonald', | |
'Stuart McDonald', | |
'Alasdair McDonnell', | |
'John Martin McDonnell', | |
'Pat McFadden', | |
'Natalie McGarry', | |
'Conor McGinn', | |
'Alison McGovern', | |
'Liz McInnes', | |
'Catherine McKinnell', | |
'Anne McLaughlin', | |
'Patrick McLoughlin', | |
'Jim McMahon', | |
'John McNally', | |
'Stephen McPartland', | |
'Alan Meale', | |
'Ian Mearns', | |
'Mark Menzies', | |
'Johnny Mercer', | |
'Huw Merriman', | |
'Stephen Metcalfe', | |
'Ed Miliband', | |
'Maria Miller', | |
'Amanda Milling', | |
'Nigel Mills', | |
'Anne Milton', | |
'Andrew Mitchell', | |
'Francie Molloy', | |
'Carol Monaghan', | |
'Paul Monaghan', | |
'Madeleine Moon', | |
'Penny Mordaunt', | |
'Jessica Morden', | |
'Nicky Morgan', | |
'Anne Marie Morris', | |
'David Morris', | |
'Grahame Morris', | |
'James Morris', | |
'Wendy Morton', | |
'David Mowat', | |
'Greg Mulholland', | |
'Roger Mullin', | |
'David Mundell', | |
'Ian Murray', | |
'Sheryll Murray', | |
'Andrew Murrison', | |
'Lisa Nandy', | |
'Bob Neill', | |
'Gavin Newlands', | |
'Sarah Newton', | |
'John Nicolson', | |
'Caroline Nokes', | |
'Jesse Norman', | |
'David Nuttall', | |
'Brendan O\'Hara', | |
'Matthew Offord', | |
'Melanie Onn', | |
'Chi Onwurah', | |
'Guy Opperman', | |
'Kate Osamor', | |
'George Osborne', | |
'Kirsten Oswald', | |
'Albert Owen', | |
'Ian Paisley Jnr', | |
'Neil Parish', | |
'Priti Patel', | |
'Owen Paterson', | |
'Steven Paterson', | |
'Mark Pawsey', | |
'Teresa Pearce', | |
'Mike Penning', | |
'Matthew Pennycook', | |
'John Penrose', | |
'Andrew Percy', | |
'Toby Perkins', | |
'Claire Perry', | |
'Jess Phillips', | |
'Stephen Phillips', | |
'Bridget Phillipson', | |
'Chris Philp', | |
'Eric Pickles', | |
'Christopher Pincher', | |
'Daniel Poulter', | |
'Steve Pound', | |
'Rebecca Pow', | |
'Lucy Powell', | |
'Victoria Prentis', | |
'Mark Prisk', | |
'Mark Pritchard', | |
'John Pugh', | |
'Tom Pursglove', | |
'Jeremy Quin', | |
'Will Quince', | |
'Yasmin Qureshi', | |
'Dominic Raab', | |
'Angela Rayner', | |
'John Redwood', | |
'Jamie Reed', | |
'Steve Reed', | |
'Christina Rees', | |
'Jacob Rees-Mogg', | |
'Rachel Reeves', | |
'Emma Reynolds', | |
'Jonathan Reynolds', | |
'Marie Rimmer', | |
'Margaret Ritchie', | |
'Angus Robertson', | |
'Laurence Robertson', | |
'Gavin Robinson', | |
'Geoffrey Robinson', | |
'Mary Robinson', | |
'Andrew Rosindell', | |
'Steve Rotheram', | |
'Amber Rudd', | |
'David Rutley', | |
'Joan Ryan', | |
'Alex Salmond', | |
'Antoinette Sandbach', | |
'Liz Saville-Roberts', | |
'Paul Scully', | |
'Andrew Selous', | |
'Naseem Shah', | |
'Jim Shannon', | |
'Grant Shapps', | |
'Alok Sharma', | |
'Virendra Sharma', | |
'Barry Sheerman', | |
'Alec Shelbrooke', | |
'Tommy Sheppard', | |
'Paula Sherriff', | |
'Gavin Shuker', | |
'Tulip Siddiq', | |
'David Simpson', | |
'Keith Simpson', | |
'Chris Skidmore', | |
'Dennis Skinner', | |
'Andrew Slaughter', | |
'Ruth Smeeth', | |
'Andrew Smith', | |
'Angela Smith', | |
'Cat Smith', | |
'Chloe Smith', | |
'Henry Smith', | |
'Jeff Smith', | |
'Julian Smith', | |
'Nick Smith', | |
'Owen Smith', | |
'Royston Smith', | |
'Karin Smyth', | |
'Nicholas Soames', | |
'Amanda Solloway', | |
'Anna Soubry', | |
'John Spellar', | |
'Caroline Spelman', | |
'Mark Spencer', | |
'Keir Starmer', | |
'Chris Stephens', | |
'Andrew Stephenson', | |
'Jo Stevens', | |
'John Stevenson', | |
'Bob Stewart', | |
'Iain Stewart', | |
'Rory Stewart', | |
'Gary Streeter', | |
'Wes Streeting', | |
'Mel Stride', | |
'Graham Stringer', | |
'Gisela Stuart', | |
'Graham Stuart', | |
'Julian Sturdy', | |
'Rishi Sunak', | |
'Desmond Swayne', | |
'Hugo Swire', | |
'Robert Syms', | |
'Mark Tami', | |
'Alison Thewliss', | |
'Derek Thomas', | |
'Gareth Thomas', | |
'Nick Thomas-Symonds', | |
'Owen Thompson', | |
'Michelle Thomson', | |
'Emily Thornberry', | |
'Maggie Throup', | |
'Stephen Timms', | |
'Edward Timpson', | |
'Kelly Tolhurst', | |
'Justin Tomlinson', | |
'Michael Tomlinson', | |
'Craig Tracey', | |
'David Tredinnick', | |
'Anne-Marie Trevelyan', | |
'Jon Trickett', | |
'Elizabeth Truss', | |
'Thomas Tugendhat', | |
'Anna Turley', | |
'Andrew Turner', | |
'Karl Turner', | |
'Derek Twigg', | |
'Stephen Twigg', | |
'Andrew Tyrie', | |
'Chuka Umunna', | |
'Ed Vaizey', | |
'Shailesh Vara', | |
'Keith Vaz', | |
'Valerie Vaz', | |
'Martin Vickers', | |
'Theresa Villiers', | |
'Charles Walker', | |
'Robin Walker', | |
'Ben Wallace', | |
'David Warburton', | |
'Matt Warman', | |
'Angela Watkinson', | |
'Tom Watson', | |
'Michael Weir', | |
'Catherine West', | |
'James Wharton', | |
'Helen Whately', | |
'Heather Wheeler', | |
'Chris White', | |
'Eilidh Whiteford', | |
'Alan Whitehead', | |
'Philippa Whitford', | |
'Craig Whittaker', | |
'John Whittingdale', | |
'Bill Wiggin', | |
'Craig Williams', | |
'Hywel Williams', | |
'Mark Williams', | |
'Gavin Williamson', | |
'Corri Wilson', | |
'Phil Wilson', | |
'Rob Wilson', | |
'Sammy Wilson', | |
'David Winnick', | |
'Rosie Winterton', | |
'Pete Wishart', | |
'Sarah Wollaston', | |
'Mike Wood', | |
'John Woodcock', | |
'William Wragg', | |
'Iain Wright', | |
'Jeremy Wright', | |
'Nadhim Zahawi', | |
'Daniel Zeichner', | |
] | |
} | |
) | |
print 'Random Reps Selector' | |
print '========================================================================' | |
totalnames = 0 | |
for group in groups: | |
print 'Group: ' + group['name'] | |
groupcount = len(group['members']) | |
print ' Members: ' + str(groupcount) | |
totalnames = totalnames + groupcount | |
print '========================================================================' | |
print 'There are ' + str(totalnames) + ' names across all groups.' | |
print 'Aiming for a list of ' + str(targetcount) + ' names.' | |
print '========================================================================' | |
finalnamelist = [] | |
for group in groups: | |
print 'Group: ' + group['name'] | |
groupcount = len(group['members']) | |
grouptargetcount = int(round((float(groupcount) / totalnames ) * targetcount)) | |
print ' Picking ' + str(grouptargetcount) + ' names' | |
random.shuffle(group['members']) | |
for name in group['members'][0:grouptargetcount]: | |
finalnamelist.append((name, group['name'])) | |
print '========================================================================' | |
print 'Final list has ' + str(len(finalnamelist)) + ' names.' | |
print 'Writing to ' + outfile | |
output = open(outfile, 'w') | |
output.write('"Number", "Group", "Name"\n') | |
i = 0; | |
for name, group in finalnamelist: | |
i = i + 1 | |
output.write('"%s", "%s", "%s"\n' % (i, group, name)) | |
output.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment