Hi,
I am generating a CSV for importing it into Anki according to the docs. The import in general works, but seems to ignore my specifically setup deck column:
As of Anki 2.1.54, the new importer must be enabled in the preferences. I failed to mention that in the manual.
However, it will still not do what you’d like: Currently, the deck column must contain existing deck names or ids, but creating decks for missing names is a suggestion worthy of consideration.
I actually looked into compiling an apkg first, but there doesn’t seem to be a good javscript sdk at all. If CSV doesn’t do the job either, I wanted to look at Anki Connect next, but I’m open for other ideas.
It’s custom made javascript (hence my search for an sdk :P), but writing files is naturally easier than generating CSV. Let me give ki a shot, thanks for the hint.
PS: Keep the ideas coming
PPS: FileNotFoundError: [Errno 2] No such file or directory: 'tidy'@langfield
fixed this error.
So with my own code I’d be “converting” my CSV to individual markdown files, containing front and back as ### headers. Do I need to create the model.json manually?
Wow thanks! You’ve totally found a missing dependency I forgot to write in to the install instructions!
You do not need to create the models.json file manually unless you are generating notes with a previously-unseen-by-your-anki-installation notetype. What is the notetype of the notes you’re generating?
If you’re using an existing notetype, I would suggest simply copying the models.json file into the deck folder you’re generating.
Neat! When you get around to making a custom notetype, just create it in Anki and then ki pull the changes into your repository. Then the new notetype should be in your top-level models file.
Wow! How large is your Anki collection? All this command does is copy the repository and run git init, so I’m surprised it’s taking so long. Got a lot of media?
A pull/push cycle (which I even need to do without content changes to the database apparently) takes about 40m. Recently I’ve been hitting [Errno 12] Cannot allocate memory a lot. A du -hs collection says 2.2GB.
That’s an error about RAM not being enough, not the hard drive space. You may want to enable some swap, but if you don’t have any partition available to do so it may be a bit hard.
@Zifix Yeah this is definitely a bug, one way or another. I’ve stress-tested ki on the largest decks I could find, and the max wall-clock time for a push-pull cycle was on the order of two minutes. So sorry you’ve run into this problem!
Any chance you’d be willing to share your collection (even privately) so I could build a test case out of it?
If you are willing to do this, I can let you know once I’ve sped it up enough that it will work for you use case!
It will force you to pull any time the hash of the database file changes. So if you open Anki and then close it, that will modify the .anki2 file, requiring you to pull again.
Thanks for bringing up the issue though, I’ll look into a more intelligent way to figure out if changes have been made. Perhaps if I can figure out a way to content-address only the contents of the database that we need to write to disk, we can avoid this. It would have to be a substantially quicker process than cloning a copy of the collection, though.
Actually this is the first custom deck I’m building. I suppose (don’t know where to find proper stats…) that AwesomeTTS bloated my sqlite quite a bit when I rendered voice for a few thousand cards
Anki doesn’t have any perceivable problem for it. I can maybe offer a small degree of consolation: didn’t get very far with Anki Connect either. I think it’s an incompatibility with the Anki version and reported a bug there as well.