Add more data

Also renamed some of the files and had to change some code to account
for the new names.
This commit is contained in:
Nate Bowman
2026-10-14 19:01:48 -04:00
parent 10b02e3540
commit 6e1b876a14
8 changed files with 36091 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ def _fill_maps(big, key, whitelist):
def create_maps(namelist_fname, key):
# Read in the full data dictionary
with open(config.data_file, 'r') as f:
with open(config.name_data_file, 'r') as f:
big = json.load(f)
# Use whitelist to filter data and map only as needed
@@ -33,8 +33,26 @@ def create_maps(namelist_fname, key):
return names, nums
def read_data_to_dict(key):
with open(config.data_file, 'r') as f:
def read_string_data_to_dict(keys):
return _read_file_to_dict(config.string_data_file, keys)
def read_name_data_to_dict(keys):
return _read_file_to_dict(config.name_data_file, keys)
def read_data_to_dict(keys):
return _read_file_to_dict(config.data_file, keys)
def _read_file_to_dict(fname, keys):
if not type(keys) is tuple:
keys = (keys,)
with open(fname, 'r') as f:
all_data = json.load(f)
return all_data[key]
for key in keys:
all_data = all_data[key]
return all_data