Get the currently selected Deck

Hello guys,

i recently fell in love with anki and because i knew, that anyone can write an addon with python, in which i’m very familiar with, i want to make myself a simple addon.
I want to get the currently select Deck and work with it.
So is it possible to get an python instance of the currently selected Deck.

Also is there i way to query cards, like with the normal browse tab in anki.

Thanks in advance

Use mw.col.decks.current() to get the current deck, mw.col.find_cards() to query cards.
See The 'anki' Module - Writing Anki Add-ons for some examples.


Thanks abdo! That helped a lot.