Extending Splitwise’s currency conversion

25 Apr 2017

Python  Tools  Web 

Originally posted at https://tech.labs.oliverwyman.com/blog/2017/04/25/extending-splitwises-currency-conversion/

I’m rather fond of Splitwise, which is an app/website for recording money owed between multiple people. Myself and my partner use it a lot for various expenses, and it’s really useful when you’ve got many different payments, and you need to keep track over time. We’ve got one repeated payment however that’s been in US dollars, and Splitwise helpfully keeps track of that separately from the stuff in pounds sterling, but given it’s coming out of a British account anyways, I’d rather have it listed in sterling. The way to do this would be to convert it on the day, and Splitwise will do “convert all historical items using the current conversion rate” but I’d like to use the day-by-day rates. The more complicated version had been suggested, but had been rejected due to it probably making things more complicated for most users, which is fair enough. OTOH, they’ve got an API 🙂

So, I built Moolah, which is a tool for doing said conversion. Long-time readers will note it looks a lot like Docket, and I did borrow a lot of the existing code, as quite frankly it’s a similar problem. You can manually update things one by one, and it’ll also update them automatically every so often. I’m using the day-by-day rates from fixer.io, which are slightly imperfect (most recent working day, doesn’t know some currencies e.g. AED) but it’s a free service and good enough for my purposes. The Splitwise API was a little fiddly to work with, as the “update_expense” docs require you to have read the “create_expense” docs as well and do a bit of creative thinking when something doesn’t work, but the support people at Splitwise were also lovely and very responsive to my queries, so thanks! Code is as always available in the usual sort of place.

Previously: Generating Beatnik code Next: How to actually secure IoT devices