Filter cards by number of repetitions left + AnkiConnect & filtered decks

Hello,

I’d like to know if it’s possible to filter cards according to the number of repetitions left until graduation. [The documentation](can’t insert link sorry) doesn’t seem to offer a solution. A query such as “rated:1:1” gives me all cards answered “Again” at least once today, but I would like to target those cards specifically that I have answered “Again” when I encountered them for the last time; those for which failure was followed by a successful answer would not appear (they would have one less step to go before graduation than the previous category).

With AnkiConnect, one can see the number of repetitions left until graduation with the “left” parameter (said parameter doesn’t seem to follow the rules given in the [AnkiDroid documentation](can’t insert link sorry) : in my tests it always yields a single digit, never something such as 2003):

currentQuery = invoke("findCards",query="rated:1:1 is:learn is:review")
currentQueryInfo = invoke("cardsInfo",cards=currentQuery)
for cQ in currentQueryInfo:
    print(cQ["fields"]["Text"]["value"],"| reps left before grad",cQ["left"])
>>> ཆུ་ཐམས་ཅད་དེར་སོང་སྟེ་། སྐོང་ཆུ་ལག་ཏུ་{{c1::ཐིམ}}་མོ་ | reps left before grad 2
>>> མདོ་སྡེ་པ་དག་ འདུས་བྱས་རྣམས་ སྐད་ཅིག་གིས་{{c1::འཇིག་པ}}་ཞེས་ འདོད་དོ། | reps left before grad 1

Can one achieve the same result in the “Browse” window of Anki?

A small related question: what would happen if I were to move cards with the AnkiConnect changeDeck command from their regular deck to the a custom study deck? Would they behave as cards placed there when I hit the rebuild button in the application itself, viz. would they move back to their original deck once answered?

Thanks for taking the time to read me!

There is no built-in search query for that.

I see, thanks for taking the time to reply! And since this is the first time I have the pleasure to address you, let me state how infinitely grateful I am for all your hard work creating and updating Anki!

I’ve come up with a very simple solution: AnkiConnect assigns a certain flag to the cards I’m interested in, and then I use a filtered deck in Anki itself to target said flag. This way I avoid using the changeDeck function, whose effects when setting a filtered deck as the destination I am wary of (maybe unjustly so).

1 Like