updated json genertion in python