use json instead of prepocessing in python (fix #5)