Files
CoolProp/dev/clean_up_json.py

14 lines
314 B
Python

import json, sys, glob, os
here = os.path.dirname(__file__)
sys.path.append(here+'/..')
from package_json import json_options
for fluid in glob.glob(here+'/fluids/*.json'):
print(fluid)
j = json.load(open(fluid, 'r'))
fp = open(fluid, 'w')
fp.write(json.dumps(j, **json_options))
fp.close()