Files
CoolProp/dev/clean_up_json.py
2019-10-17 19:05:55 -06:00

14 lines
331 B
Python

import json, sys, glob, os
here = os.path.dirname(os.path.abspath(__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()