Converted the converter script to python