Hi! I'm currently reworking my site, so although this content is still online things may change or look odd. Please get in touch to find out how I can help you!

Smile CSV Scraper for FreeAgent and Xero

Are you happy with your bank? I am. I use Smile and they're five-nines awesome - I heartily recommend them to anyone who banks in the UK. The real killer feature - their ethical policy as part of the Co-operative Bank - something all commercial banks should have in my opinion.

One thing they don't do though, is allow you to export your statements in any kind of format - which is kind of a pain for users of services like FreeAgent or Xero as it makes it hard to reconcile your banking transactions. I resorted to copy-pasting the data from the table and reworking the CSV by hand - a bit of a drag to say the least.

No more!

That continued until last week, when I saw a tweet about Aral Balkan's CSV scraper for his HSBC statements - a similar problem, which made me wonder if the code could be converted to work on the Smile statements.

Luckily, Aral is generous enough to share his scraper code under a Creative Commons license, so I got to work and came up with this:

The bookmarklet

Smile Prepare CSV

Drag the above link into your bookmarks toolbar to create a shiny new bookmarklet: Example showing where to drag the bookmarklet

How to use it

My script works in exactly the same way as Aral's:

  1. Sign in to your Smile account and navigate to a statement
  2. Click the "Smile Prepare CSV" bookmarklet
  3. Click the little "copy to clipboard" icon that appears in the row of buttons above the statement: Example showing the button to copy the CSV to the clipboard
  4. Paste the generated CSV into a plain-text editor
  5. Save the file with a .csv file extension
  6. Upload the saved file to FreeAgent or Xero

More info

The CSV generated is in the format described by FreeAgent on their help pages. I'm reliably informed that it will also work with Xero, but you will need to teach Xero what each field in the CSV means the first time you upload.

You can view the source if you want to see what's going on, my comments aren't as entertaining as Aral's I'm afraid but it should be easy enough to see how it works. The first part of the file is just includes, the real code starts at line 323.

Credits & licensing

Really all I've done here is take Aral's work and make a few tweaks, so huge kudos to him for not only coming up with the idea but also being cool enough to share the fruits of his labour under a permissive license.

As such, this code is released under the same license as Aral's - the Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Thanks also to the authors of the components that do most of the heavy lifting, they are:

Main image credit: "20 Pounds" by Stephen Davies

Tags: Productivity Work

Feedback

Sorry, feedback is now closed on this post, but please feel free to get in touch if you would like to talk about it!

Or find posts by tag →

Friends & Influences

  1. Aching Brain
  2. Andy Budd
  3. Anthony Killeen
  4. Ben Everard
  5. Cameron Moll
  6. Dan Cederholm
  7. Dan Mall
  8. Dave Shea
  9. Elliot Jay Stocks
  10. Jamie Knight
  11. Jamie Rumbelow
  12. Jason Santa Maria
  13. Jeff Croft
  14. Jeffrey Zeldman
  15. Jeremy Keith
  16. Jon Hicks
  17. Khoi Vinh
  18. Mark Boulton
  19. Matt Croucher
  20. Nocturnal Monkey
  21. Sarah Parmenter
  22. Shaun Inman
  23. Simon Collison
  24. Tim Van Damme
  25. Toby Howarth