First commit of python port for NPI script.