Roughly a year ago I started trying to reverse-engineer the Anki database schema (with the help of the documentation provided by the AnkiDroid repository on GitHub). While my approach was successful it was not really resilient. I know it is not possible to have apps or websites connect to the Anki mobile app like AnkiDroid on android. My question thus is: what is the easiest way to import a bunch of cards together with a specific model or at least kinda referenced to one so that when reviewing cards after importing them they show up in the proper form and in the right deck. I read importing plain text files works pretty good for basic use cases, but I wonder if thereâs an easier and better way to achieve what I want while retaining meta data about the cards model.
You can specify the notetype and field mapping, but itâs not possible to define the notetype inside the file, so if youâre distributing things to others, youâd need to get them to import an .apkg with the notetype first.
Thanks for the swift reply Damian. From a practical point of view: Would the most feasible option be, to simply create an empty deck where the note type is defined and after this one is imported once then users could simply continue importing CSVs?
I am asking as I had some trouble getting all the fields of the SQLite database right the last time I worked on the project; Mainly the ordering was messed up (You answered this already on a separate occasion if I am not mistaken). Simply importing CSVs seems to be the better option here.
I donât think you can do it with an âemptyâ deck â but you can create a single sample note that will carry all the parameters of the notetype with it when you export it as an APKG.
The bonus is that you can export that sample note as a CSV as well, and that will give you the columns/fields structure youâll need to enter your data correctly.
Itâs possible Iâm not understanding your use-case, but if this is something youâre going to share with other users, it seems easier to export it as a unified APKG, than to export it as a sample-note APKG followed by CSVs with all the data.
My way of thinking is the following: To gather the necessary information about the used model an import of an .apkg file is necessary only once. All subsequent imports could then be done via .csv which is simply easier to deal with than a SQLite db. As stated above, my main motivation stems from the fact that I went down the route to offer importing .apkg files before, but kinda ran into problems here with the card ordering (probably due to some misconfigured values in the âdueâ column. Thus instead of doing the difficult work here myself Iâd simply import a .csv and let Anki figure out the rest internally (I expect the due date of these new cards to be set in the order they appear in said .csv). I hope my reasoning is clearer now.
Yeah of course. If Iâd create the data through Ankiâs own export function it would be silly not to choose exporting an .apkg file. But I am rather getting the data elsewhere and simply wish for an easy way to import these collections into Anki.