import json asset_data = json.load(open("../procthor_assets/asset-database.json", "r")) results = {} for asset in asset_data["Window"]: results[asset['assetId']] = {"boundingBox": asset["boundingBox"]} results[asset['assetId']]["size"] = [asset["boundingBox"]["x"] * 100, asset["boundingBox"]["y"] * 100] if "Bay" in asset['assetId']: results[asset['assetId']]["type"] = "bay" elif "Fixed" in asset['assetId']: results[asset['assetId']]["type"] = "fixed" elif "Hung" in asset['assetId']: results[asset['assetId']]["type"] = "hung" elif "Slider" in asset['assetId']: results[asset['assetId']]["type"] = "slider" json.dump(results, open("window-database.json", "w"), indent=4)