Initial commit

This commit is contained in:
Nate Bowman
2026-10-04 01:39:29 -04:00
commit 62907fd6ee
17 changed files with 81318 additions and 0 deletions

34
decks/research-costs.py Normal file
View File

@@ -0,0 +1,34 @@
from flashcards.decks import create_deck
from flashcards.maps import read_data_to_dicts
# your choice of deck name and filename
deck_name = 'Research Costs'
deck_fname = 'research-costs'
# specify the namelist used to create the deck
namelist = 'research'
# key into json file specifying which data you want
# uncomment either 'units_buildings' or 'techs'
#data_json_key = 'units_buildings'
data_json_key = 'techs'
# --- create list of notes ---
# read in data and maps between names and numbers
data, nums, names = read_data_to_dicts(namelist, data_json_key)
# create cards based on data and maps
notes = []
for num, name in nums.items():
cost = data[num]['cost']
back = '\n'.join([f'{res}: {val}' for res, val in cost.items()
if val != 0])
notes.append((name, back))
#print(f'front: {name}\tback: {back}')
# write deck to .apkg file
deck = create_deck(notes, deck_name, deck_fname)