Why I made a dataset of LGBT MPs

How many Members of Parliament were lesbian, gay, bisexual or transgender at the time of the 2017 General Election? A niche question, for sure, but until a few weeks before that election there was no easy answer.

You could try searching Google but youā€™d end up none the wiser. Wikipedia did not have the answer. In fact, it was (and still is in some cases) listing MPs based on tabloid gossip. There were some sources that did snapshots in time, like the The LGBT Representation and Rights Research Initiative at the University of North Carolina at Chapel Hill, but ā€” as snapshots ā€” these lists were quickly out of date.

Back in 2017, I worked in the LGBT Policy Team in the Government Equalities Office. Like every government team, we had top lines that included useful facts and statistics. The number of LGBT MPs was one of those facts we liked to include. When the election rolled round, we didnā€™t know the answer. At best, we knew the answer we had would be out of date in a matter of weeks and we didnā€™t know how quickly a third party would do the sums.

That was a problem I decided I could fix.

Start with user needs

I could have simply figured out the answer by doing a lot of Google searches and left it at that. That would have given us the answer we needed in the aftermath of the election but it wouldnā€™t have been a long term solution.

We needed something that was responsive to change1 so that our key facts were always correct in the moment. We also needed to be confident the sources were truthful and accurate; something most third parties couldnā€™t offer because their methodologies for collecting the data were unclear.

Put another way, I had a pretty straight-forward user need:

As a policy official, I need regularly updated and independently verifiable information about LGBT MPs, so that I can use the information in my work

Make things open: it makes things better

A clever bunch of people once came up with some design principles for what a good service looks like. For this project, perhaps the most important one is this:

Make things open: it makes things better.

Thatā€™s exactly what I decided to do.

I created a website backed up by a simple dataset. Itā€™s open source, meaning it can be easily updated, interrogated, verified or extracted for use elsewhere.

Itā€™s built using Jekyll, which means I have been able to host it freely on Github2. Anyone can contribute to the code, because the repository is public.

Anyone can contribute data to the dataset too, and itā€™s as easy as updating a spreadsheet because thereā€™s no database. Itā€™s nothing more than a couple of CSV files.

Iterate. Then iterate again

I started with the minimum viable product: a dataset that listed those MPs who were LGBT on the date the dataset was compiled. Then, I created a probably overkill, but very pretty3 website to display that data more interestingly. The website was generated dynamically as the dataset was updated. ā€œJob doneā€, I thought, but the minimum viable product ā€” the dataset ā€” quickly became less-than-minimum.

The original dataset only captured the MP, their constituency, and the source of the data. Following the election, some MPs changed constituencies, some lost their seats, and others joined Parliament for the first time. During the 2017 to 2019 Parliament, some MPs changed parties and groups too; sometimes multiple times. That meant the dataset as conceived on day 1 was, practically, no more useful than the snapshot dataset I was trying to improve on. So I iterated.

I changed the dataset to include the date an MP took their seat, their last day in office or any changes in constituency or party if applicable. I also created a separate dataset to show all the parties in a given Parliament, even if they had no sitting LGBT MPs in their party. And I kept iterating.

Now the dataset and website allow you to see current LGBT MPs in Parliament, but also go back to snapshots for previous Parliaments. It took a lot of trial and error iteration, but now the dataset is in a format that can be easily and continually updated in a future-proofed way.

It meets the user need

As a policy official, I need regularly updated and independently verifiable information about LGBT MPs, so that I can use the information in my work

Does this dataset and website meet the user need it was intended to? Yes.

Creating this dataset meant that, when I had needed the answer for work, there was a baseline source for the information that I felt like I could trust. It also meant my colleagues could easily get the answer too.

Making the data freely available on the open web has improved the available data as well. Other people have come looking for this data, and theyā€™ve contributed their own information sources4.

The dataset substantially improves on what came before it, because it shows how we know each MP is LGBT. Many of the sources are directly attributable to the MP themselves, rather than third parties.

Possibly the most important way I know this has been a useful endeavour though, is because itā€™s been used beyond just me and my old team. The dataset has been used by the BBC5, Sky News6, and Quartz7.

Made something open: it made the thing better

If thereā€™s a moral to this story, itā€™s that I made an open dataset and making it open made it better.

This dataset isnā€™t the end state. There are things that need to be iterated on. You currently canā€™t find out how an MP identifies; which is important, because as far as we know all these MPs have a minority sexual orientation but none of them are transgender. The dataset also doesnā€™t discriminate between those who were out when they came into office, versus those who came out in office. So thereā€™s still work to do.

Looking a bit wider, the code and principles behind the work provide a foundation for other projects too: Iā€™ve now started compiling a list of LGBT ministers in the UK Government.

And you never know, maybe one day Iā€™ll be able to start a list of LGBT Prime Ministers too.

Visit ā€˜LGBT MPā€™ to find out which Members of Parliament are lesbian, gay, bisexual or transgender.

  1. Given how much changed during the 2017 to 2019 Parliament, we needed that more than we could have realised at the time!Ā ↩︎

  2. Github lets you host projects for free on their website if youā€™re building them in Jekyll. The domain name costs me about Ā£20 a year.Ā ↩︎

  3. It gave me an excuse to create this pride inspired portcullis. A different portcullis is part of the UK Parliamentā€™s official brand identity.Ā ↩︎

  4. I, of course, looked to update the dataset in the wake of the December 2019 general election. In the days after the poll, I had people tweeting at me that Iā€™d never met, letting me know which MPs Iā€™d missed and even sending me sources. My favourite was perhaps where someone had pointed me towards a speech of newly appointed Darlington MP Peter Gibsonā€™s in which he thanks his partner for their support during the campaign.Ā ↩︎

  5. BBC News, 11 June 2017, Election results 2017: The most diverse Parliament yet; and 17 December 2019 Election 2019: Britainā€™s most diverse Parliament.Ā ↩︎

  6. Sky News, 16 December 2019, General election: 2019 heralds the most diverse parliament for gender and ethnicity.Ā ↩︎

  7. Quartz, 17 December 2019, The UKā€™s new parliament is its most diverse ever.Ā ↩︎