Mokupapapa python and postgres code