Small ruby gem for searching through your SRS items

Hi there,

I’ve just published a ruby gem called saru. It’s not intended to be like the existing (and great!) Wanikani gem, that pretty much covers all the API requests. This is focused only in the SRS items, and it implements some handy methods to make some useful searches.

For instance, you could check those Kanji that you seem to keep failing over and over again (which is the main itch behind creating this gem, btw) by doing:

require 'saru'

Saru.setup do |config|
  config.api_key = 'your_api_key'
end

Saru.kanji.srs_is_not_burned.total_incorrect_larger_than(10)

That will return all kanjis not burned that you have failed more than 10 times (reading + meaning).

You can also export any search to an Anki deck, in case you need extra support:

> Saru.kanji(1..26).srs_is_not_burned.total_incorrect_larger_than(10).export_to_anki
Anki file generated in saru_deck_1704211620.txt
=> nil

You can check the source code and some more examples in github. Not all attribute searches are implemented yet, be my guest if you want to fork it and add them!

Cheers

EDIT: Added the Anki export information

1 Like

Nice job! I’m not really a Ruby user but I might give this a whirl sometime

1 Like