A python implementation of the SWIM protocol