WaniKani to Anki Exporter - http://wanikanitoanki.com

Hey guys,



tl;dr: I made a website to export some WaniKani data into Anki decks - http://wanikanitoanki.com/. I hope someone else besides me finds this useful!



For the past week or two I've been building a small website to export some WaniKani info into Anki decks. The reason I want to use Anki for WaniKani information is because it gives me a good place to practice my Japanese writing skills. I also occasionally use it to have those pesky "critical items" that I can't see to wrap my head around in Anki as well.



I decided to release this little project out to the masses just in case somebody else finds this as useful as I have so far. Feel free to give it a test drive. You'll need your public API key to be able to fetch the information from WaniKani, which you can find in your account settings.



After you enter the site using your API key, you'll have a few options to download. There's some options you can tweak, like the maximum correct percentage of the Critical Items you want, or specific levels for Kanji, Vocabulary or Radicals. When you click the Download button, you should have downloaded a plain text file. You can then import this file into either an existing Anki deck or a new one (by selecting File -> Import in Anki).



Note: Since the generated decks are plain text for now, they will not include radicals that don't have a Unicode character for it. I'm working on a fix for that.



I'm sure there will be plenty of unknown issues cropping up as more people use the site. So feel free to let me know either here or on Twitter about any problems anyone encounters, as well as suggestions on how to add more cool functionality to this.



I'll be spending time working on the site as possible, adding tutorials, fixing bugs and doing some housecleaning to open source the code in case anyone wants to see its inner workings (although there's honestly not much there to see). It's been a fun little learning experience with some new tools so I'd love to do more with it.



I look forward to some people using this thing!

15 Likes

Fantastic, thanks for your work!

Really looking forward to using this!

Nice work. Seems to work just fine. That WaniKani to Anki plug-in has been broken for quite a while and I think the developer left the community so it’s nice to see a replacement. It’d be nice if you could download the WaniKani audio samples somehow (I’m actually not sure if their license allows that).

Note to everyone: You can also use this to make reverse decks, you just have to create a note type for it before importing.

Yay!

That’s cool. Thanks!

Hey, thanks for the cool website.

Found a few things so far: if I select download specific levels, I have to click and hold on the text box to be able to type anything. Second, and this probably just has to do with having so many items, if I try to download all my vocab it gives me a timeout error (503 service unavailable). I assume I would just have to download each level to circumvent this; I’ve actually had the same error on another app and I don’t think there was any fix for it.

Other than that, great work. Keep it up!

works perfectly, thank you!

This is great, thanks! I’m sort of new with anki…is there a way I can just use the hiragana and english in the generated cards? That’s the part I have trouble memorizing

Thanks for the feedback, everyone! Glad to hear that this is being useful to someone other than myself.

looki, WaniKani only sends back a little bit of data for each of their items, and the audio is not included in that deal. I’m sure it’s not in their best interest as a company to be giving that away easily :slight_smile: I hope to add additional information to the site, like tips / tutorials or something similar, to better explain examples like you mentioned about having different note types for creating different types of decks, so thanks for bringing that up.

Calion, you are correct - the download process is timing out when getting all of your levels of kanji, vocabulary or radicals, considering you’re on Level 45. While building this I tested getting all levels up to Level 50 on my laptop and I wasn’t able to do so past a certain point. I’ll dig a little deeper to figure out how I can solve this issue for you and others. I’ll also take a look at the textbox issue you mention. Besides Google Chrome I haven’t done extensive testing on other browsers so I’ve added that to my to-do list.

zquaitte - hmm, I’m not sure if I’ll do that for the site. The focus of WaniKani is learning kanji, so I don’t feel like having options to remove kanji parts is useful to most people. The downloaded files are plain text, however. You can open them in any text editor you have on your computer and edit them, so that’s an option for you there.

As I mentioned in my original post, I’ll open-source this code soon and have a Github account where issues can be reported or pull requests can be made. I’ll share that as soon as I have it out there!

When I import these into anki, they all end up in the same deck. And that causes the some things to get replaced by one another. I’ve tried renaming and what not, but no luck.

It would be most useful if you could export the level number for each item as well; to use as a tag in Anki. For example “七;しち;seven;Level1” Pretty please flutters eyelashes

Calion said...Found a few things so far: if I select download specific levels, I have to click and hold on the text box to be able to type anything. Second, and this probably just has to do with having so many items, if I try to download all my vocab it gives me a timeout error (503 service unavailable). I assume I would just have to download each level to circumvent this; I've actually had the same error on another app and I don't think there was any fix for it.

dennmart said...Calion, you are correct - the download process is timing out when getting all of your levels of kanji, vocabulary or radicals, considering you're on Level 45. While building this I tested getting all levels up to Level 50 on my laptop and I wasn't able to do so past a certain point. I'll dig a little deeper to figure out how I can solve this issue for you and others. I'll also take a look at the textbox issue you mention. Besides Google Chrome I haven't done extensive testing on other browsers so I've added that to my to-do list.
 From my experimentation it seems WaniKani times out after ~30s. The only work around I know of is to break the request into multiple smaller requests.

looki said... Nice work. Seems to work just fine. That WaniKani to Anki plug-in has been broken for quite a while and I think the developer left the community so it's nice to see a replacement. It'd be nice if you could download the WaniKani audio samples somehow (I'm actually not sure if their license allows that).

Note to everyone: You can also use this to make reverse decks, you just have to create a note type for it before importing.
 Is it returning 503 errors? Since that affects everything using the API. The WaniKani to Anki 2 plugin is written in Python so it's easy to modify if it needs to be fixed.
Ku-ma said... It would be most useful if you could export the level number for each item as well; to use as a tag in Anki. For example "七;しち;seven;Level1" Pretty please *flutters eyelashes*\
This is good. Please!

neya - I’ll look into that this weekend. I’m sure there’s something I can do better to help with the import process with Anki.

amclean - The issue is not because the WaniKani API is timing out - It’s timing out on my end when generating the data for the download, since it’s a sizeable amount of data. I checked just now and there are 4541 vocabulary items from level 1 to 45, so it takes a long time to process all that data. I’m sure I can optimize this process since I wasn’t thinking about that use case.

Ku-ma and Saponutti - I was planning on adding more robust tag support, but I can add the levels pretty quickly. Look for that option to be added sometime today!

As always, thanks for the feedback! I look forward to hearing of more ways to improve this mini-site!

Thanks for the website! Is there any chance that you’d make an option for exporting burned items only?

dennmart said... amclean - The issue is not because the WaniKani API is timing out - It's timing out on my end when generating the data for the download, since it's a sizeable amount of data. I checked just now and there are 4541 vocabulary items from level 1 to 45, so it takes a long time to process all that data. I'm sure I can optimize this process since I wasn't thinking about that use case.

I never did check whether it was WaniKani or my browser/python timing out because as far as I know HTTP 503 is a server-side error.

I'll have to check that now.

EDIT: It is WaniKani timing out after ~30s. Python's default timeout is supposed to be infinite and setting a timeout of five minutes still returns an HTTP 503 error after ~30s.

nqthqn - That’s on my to-do list! Along with other options to download, like recent unlocks.

amclean - Hmm, maybe Python’s library for HTTP requests is different? I haven’t used Python much so I’m unsure if there’s some difference there. This website I made is built in Ruby (Padrino framework), and my sub-optimal processing of creating a downloadable file for that many items is what’s causing the 503 in my case. Still, I’m looking into it.

Ku-ma and Saponutti - Just a reminder I still haven’t forgotten your request :slight_smile:

dennmart said... amclean - Hmm, maybe Python's library for HTTP requests is different? I haven't used Python much so I'm unsure if there's some difference there. This website I made is built in Ruby (Padrino framework), and my sub-optimal processing of creating a downloadable file for that many items is what's causing the 503 in my case. Still, I'm looking into it.
To clarify I'm specifically talking about WaniKani returning an HTTP 503 error to the application making an API request. In your case it would be your site receiving an HTTP 503 error when attempting to retrieve the user's API data. Your site might return an HTTP 503 error to the user for some reason but that is a separate issue.



I’m able to reproduce the problem in Chrome and Firefox as well; WaniKani’s HTTP 503 error page is the “missing turtles” page. You might not be able to reproduce it because it seems to be dependent on how many items you have.

Ah, that clarifies this whole thing. Sorry for the misunderstanding!