d83e7e8e09c576d2e16de8529a842b33937f5c88
This reduces the boilerplate code that the user needs to deal with in the deck-creation scripts.
Project structure:
data/ -- input files from AoE itself (taken from another project)
decks/ -- python scripts to create individual decks
* actual decks are not stored here
* it should be called deck-creators, but I don't want to type that
flashcards/ -- all of the useful library code is in here
output/ -- files generated by the project
decks-output/ -- generated decks that can be read into Anki
namelists/ -- lists containing names to include for particular decks
settings.yaml -- controls where files are read from and written to
Once you have data in the correct format, creating the cards is trivial. The data is provided by another project (I'll link it when I think about it; the name of the larger group is SiegeEngineers) and pulled directly from AoE itself. However, the names and identifiers used in the data can be tricky. Most of the work here is to create mappings between names and id numbers for that data.
Big picture process:
- Create a list of names that you want included in the deck
- These are not just any names -- they need to match what is used in the data file. Use the process below to help with this.
- Create a deck using just these names. The library handles the mapping of names to id numbers for you.
Process:
- Run flashcards/create_full_namelists.py
python -m flashcards.create_full_namelists- This generates two files in output/namelists/
- Each file corresponds to one key in the data file: "units_buildings" and "techs"
- Make new namelists by deleting unused entries from the generated namelists
- This is the worst part
- You want to remove only the entirely useless things at first
- When finished, keep around these pruned namelists and start your deck namelists as copies of them so you don't need to redo this step
- You can also just use the one I added, but there's no guarantee it is up-to-date or mistake-free
- Copy one of the pruned namelists and delete more entries until you have just the names you need for a given deck
- Using one of the scripts in decks/ as a template, write a Python
script that reads your generated maps and the data file and outputs an Anki
deck
- Unless you want to add the flashcards package to your path,
you must run with
python -m decks.{file name without .py extension} - The deck will be stored in output/decks-output/
- Unless you want to add the flashcards package to your path,
you must run with
- Open Anki and import the deck
Description
Languages
Python
100%