cic-schema/bundle.py
2023-03-05 10:00:23 +00:00

39 lines
806 B
Python

# standard imports
import json
import os
fp = os.path.join('.', 'cic.in.json')
f = open(fp, 'r')
o = json.load(f)
fp = os.path.join('.', 'mime.in.json')
f = open(fp, 'r')
o_mime = json.load(f)
o['mime'] = o_mime
fp = os.path.join('.', 'opensea_part.in.json')
f = open(fp, 'r')
o_opensea = json.load(f)
for k in o_opensea['properties'].keys():
p = {}
for v in o_opensea['properties'][k]:
p[v] = o_opensea['properties'][k][v]
o['properties'][k] = p
o['required'] += o_opensea['required']
o['oneOf'] = o_opensea['oneOf']
fp = os.path.join('.', 'nft.in.json')
f = open(fp, 'r')
o_nft = json.load(f)
for k in o_nft['properties'].keys():
p = {}
for v in o_nft['properties'][k]:
p[v] = o_nft['properties'][k][v]
o['properties'][k] = p
print(json.dumps(o))