Eduskunta Votes

Yesterday, I had hoped to work with Juha on trying to transform Eduskunta voting information via the KansanMuisti API into the new Popolo draft Voting specification. Unfortunately we weren’t able to do that, so today I’m going to try muddling through on my own.

Their API doesn’t seem to be documented anywhere, but the source code informs me that it’s just TastyPie underneath, so I can mostly work out what I need.

My best entry point seems to be the list of plenary sessions — looking specifically for ones that had votes. I don’t seem to be able to sort or filter that list, but the first page is ‘most recent first’, which is good enough for now.

Once I find one with a vote (e.g. 9905), I can then follow the links in that to the plenary session item, which will give me the surrounding context for what the vote is about, what stage it’s at, and a link to any associated documents. I can then look up the individual MP votes from the id.

Based on this I wrote a simple script that, given the ID of a plenary session, fetches all this data and returns it as JSON.

Next step: transforming that JSON into the new Popolo Vote format.

Leave a Reply

Your email address will not be published. Required fields are marked *