This project is a Python script that generates Japanese Anki flashcards from a word list using OpenAI.
The generated cards include word readings, pitch accent, example sentences, and definitions.
This Python script significantly simplifies the process of creating new cards, allowing advanced learners to focus on studying rather than card creation.
- Python
- OpenAI API key
- Anki + AnkiConnect
-
Install dependencies:
pip install -r requirements.txt
-
Set your OpenAI API key in the
.env
file:OPENAI_API_KEY=your_api_key_here
-
Set your AnkiConnect key in the
.env
fileANKI_CONNECT_URL=your AnkiConnect local host address
-
Run the main.py script to create the words.txt file in the card_generation_scripts folder:
python main.py
-
Add words to the words.txt file
-
Make sure the Anki app is open.
-
Run the main.py script:
python main.py
-
follow the prompts. The script will generate the cards using the Open AI key, and the app will create the CSV files and import them into Anki automatically.
-
.env
-
.gitignore
-
README.md
-
requirements.txt
-
main.py
-
word-based-cards
- generate_csv.py
- make_anki_pkg.py
- import_to_anki.py
- create_text_files.py
- words.txt
- Be sure to set your OpenAI API key in a
.env
file. - If using AnkiConnect to automatically import cards into Anki update the ANKI_CONNECT_URL in the
.env
file to the local address of AnkiConnect.
MIT