blob: 34fb69418488f4b60dd33ca567ab01695480734f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import json
with open('danube.json') as f:
data = json.load(f)
mapping = {}
for i in data['mandatory']['value']:
for j in i['value']:
for k in j['value']:
mapping[k] = True
for i in data['optional']['value']:
for j in i['value']:
for k in j['value']:
mapping[k] = False
with open('mandatory.json', 'w') as f:
f.write(json.dumps(mapping))
|