Convert JSON generations from bash to python