Create automated Anki decks (apkg files) from datas in json files!
You will now get a step by step guide on how to use this project in the best way!
Install nodejs on your computer and set it up correctly. If necessary, run the command "node -v" in the command line to find out if nodejs is installed correctly and which version is installed.
Example output: 18.16.0
If necessary, delete the existing files from the /apkg
and /data
folders.
Add your own json files with data into the /data
folder. Pay attention to a correct format! The value "tags" is purely optional.
{
"cards": [
{
"front": "example",
"back": "example",
"tags": ["example"]
}
]
}
{
"cards": [
{
"front": "example1",
"back": "example1",
"tags": ["example1", "example2", "example3"]
},
{
"front": "example2",
"back": "example2",
"tags": ["example1", "example2"]
},
{
"front": "example3",
"back": "example3",
"tags": ["example1"]
},
{
"front": "example4",
"back": "example4"
},
{
"front": "example5",
"back": "example5"
},
{
"front": "example6",
"back": "example6",
"tags": ["example1"]
},
{
"front": "example7",
"back": "example7",
"tags": ["example1", "example2"]
},
{
"front": "example8",
"back": "example8",
"tags": ["example1", "example2", "example3"]
}
]
}
Edit the data in /config.json
. Pay attention to a correct format!
{
"decks": [
{
"dataJson": "example.json",
"deckName": "example"
}
]
}
{
"decks": [
{
"dataJson": "example1.json",
"deckName": "example1"
},
{
"dataJson": "example2.json",
"deckName": "example2"
},
{
"dataJson": "example3.json",
"deckName": "example3"
}
]
}
Start the program by opening the commandline in this folder (shortcut in Visual Studio Code: Ctrl + J) and execute the command "node .".
Example output: example1.apkg was generated! example2.apkg was generated! example3.apkg was generated!
The apkg files were generated after running the script and saved in the folder /apkg
. Now paste the apkg files into Anki.
Most of the error messages are created by me and explain how to fix them. If you don't understand a bug, or need help in general using this project, feel free to join my Discord server!
You can convert your data to json files properly in a time efficient way by using ChatGPT. You can view all ChatGPT prompts in /chatgpt_prompts
.
You need a well separated data structure. Each for the front and back side of the index cards.
Give ChatGPT an example of what the beginning of the json file should look like.
Create a json file with the data converted by ChatGPT and follow steps 3 to 6.
You are supposed to convert two data packets into one json data set. Don't give me any code, just the properly converted json file. The format of the json file:
###
{
"cards": [
{
"front": "example",
"back": "example"
}
]
}
###
first data packet for the front values of the json file:
###
frontCard1
frontCard2
frontCard3
frontCard4
frontCard5
frontCard6
frontCard7
frontCard8
frontCard9
frontCard10
###
second data packet for the back values of the json file:
###
backCard1
backCard2
backCard3
backCard4
backCard5
backCard6
backCard7
backCard8
backCard9
backCard10
###
Example for the beginning of the json file:
###
{
"cards": [
{
"front": "frontCard1",
"back": "backCard1"
},
{
"front": "frontCard2",
"back": "backCard2"
},
...
]
}
###
Here is the properly converted JSON file combining the front and back values:
{
"cards": [
{
"front": "frontCard1",
"back": "backCard1"
},
{
"front": "frontCard2",
"back": "backCard2"
},
{
"front": "frontCard3",
"back": "backCard3"
},
{
"front": "frontCard4",
"back": "backCard4"
},
{
"front": "frontCard5",
"back": "backCard5"
},
{
"front": "frontCard6",
"back": "backCard6"
},
{
"front": "frontCard7",
"back": "backCard7"
},
{
"front": "frontCard8",
"back": "backCard8"
},
{
"front": "frontCard9",
"back": "backCard9"
},
{
"front": "frontCard10",
"back": "backCard10"
}
]
}
Please note that this example includes the first two data packets for demonstration purposes. The remaining cards follow the same pattern with the corresponding front and back values.
(ChatGPT 3.5, request sent on: 20.05.2023)