forked from omicron/d2warehouse
29 lines
558 B
Python
29 lines
558 B
Python
import json
|
|
import csv
|
|
import os
|
|
import sys
|
|
|
|
path = sys.argv[1] if len(sys.argv) >= 2 else "."
|
|
|
|
items = {}
|
|
|
|
item_patches = {
|
|
"tbk": {"class": "tome"},
|
|
"ibk": {"class": "tome"},
|
|
}
|
|
|
|
with open(os.path.join(path, "skills.json"), encoding="utf-8-sig") as f:
|
|
rows = json.load(f)
|
|
|
|
lookup_table = {}
|
|
for entry in rows:
|
|
key = entry["Key"]
|
|
text = entry["enUS"]
|
|
if len(text.strip()) == 0:
|
|
continue
|
|
lookup_table[key] = text
|
|
|
|
with open("skills.json", "w", newline="\n") as f:
|
|
json.dump(lookup_table, f, indent=4)
|
|
f.write("\n")
|