forked from Electro1512/MetroidAPrime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTools.py
More file actions
23 lines (19 loc) · 686 Bytes
/
Copy pathTools.py
File metadata and controls
23 lines (19 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import json
# Initialize an empty dictionary
consolidated_dict = {}
data = {}
# Open and read the JSON fil e
with open("./data/RoomLoadouts.json", "r") as f:
data = json.load(f)
# Iterate over each row in the data
for item in data:
# Check if the room name is not in the dictionary
name = list(item.keys())[0]
items = list(item.values())[0]
if name not in consolidated_dict:
# Add it to the dictionary with the beam and item
consolidated_dict[name] = []
consolidated_dict[name] += [items]
print(name, items)
with open("./data/ConsolidatedRoomLoadouts.json", "w") as f:
json.dump(consolidated_dict, f, indent=4)