import json
import pandas as pd
metadata_file = '../CKineticsDB_metadata.json'
Contains the top-level criteria of publication, species, and reactions. Selections should be made in only one criterion for one run.
with open(metdata_file) as f:
contents = json.loads(f.read())
contents.keys()
dict_keys(['publications', 'species', 'reactions'])
This is not a required method but is used here for explanation purposes.
df = pd.read_json(contents['publications']).T
df = df[df['project'].isin(["Rh-ReOx - Ethylene Hydroformylation"])]
selected = df.to_json(orient = 'index')
The file to be read by CKineticsDB for download must have the name 'CKineticsDB_metadata.json'. To ensure this:
- Delete or rename the old CKineticsDB_metadata.json file.
- Write the selected contents to the file named CKineticsDB_metadata.json.
with open('../CKineticsDB_metadata.json', 'w+') as f:
f.write(json.dumps(selected))