- Mount your Kindle via USB and copy
system/vocabulary/vocab.db
file. vocab_sync.py
syncs the new words fromvocab.db
todefinitions.db
.fetch_defs.py
fetches missing word definitions indefinitions.db
. This is optional and requires an OpenAI API key.anki_export.py
exportsdefinitions.db
into Anki deck (.apkg file)
Config file:
[openai]
key = <your open AI key>
[anki]
deck_id = <your unique deck id>
deck_name = <name of your deck. E.g. "John's Kindle Vocabulary"
You need an OpenAI API key to fetch definitions. It is only used by
fetch_defs.py
.
Anki deck_id
uniquely identifies your personal deck. This will
allow you to re-import it when the new words were added and the deck
file was re-generated. You can generate a unique deck_id
using
the following command:
python3 -c "import random; print(random.randrange(1 << 30, 1 << 31))"
- python3
- sqlite3
How to set up virtual env (https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/):
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- The cards are very simple now: just a word and definitions. It should be possible to add IPA, usage examples, and audio.
- The use of OpenAI to fetch definitions may be controversial. An alternative definitions source, such as Oxford Dictionaries API may be implemented. This was the reason we split definitions fetching into a separate script.
https://github.com/wzyboy/kindle_vocab_anki https://github.com/johan456789/yaktoa