This code checks that an IBAN is probably valid (in that it conforms to the rules). It is not, I'm afraid, written as a module which can sensibly be incorporated into a larger project, but you're free to take the code and tweak it to your needs.
I've done my best, and I think this is correct, but I may have messed up somewhere, in terms of either facts or code logic. I suggest you test this thing before you use it in any way.