A python implemetation of tiretree