All Articles

Uk Postcode parsing library in Kotlin

Would like to use this post to let you know of a library that I’ve developed in Kotlin over the last few days named Ukpostkode. While working at Drover I had to deal with a lot of UK postcode handling, namely due to insurance provider integrations. For that I’ve used the ruby gem uk_postcode. So with this I’ve decided to implement the basic functionalities in Kotlin and I’m also planning to do the same in javascript (stay tuned!).

Here’s a brief snippet of it working

  For the postcode N1 5QJ

  val postcode = UkPostkode("N1 5QJ)
  postcode.outcode = "N1"
  postcode.incode = "5QJ"
  postcode.area = "N"
  postcode.district = "1"
  postcode.sector = "5"
  postcode.unit = "QJ"