anki.scheduler.v3
=================

.. py:module:: anki.scheduler.v3

.. autoapi-nested-parse::

   The V3/2021 scheduler.

   https://faqs.ankiweb.net/the-2021-scheduler.html

   It uses the same DB schema as the V2 scheduler, and 'schedVer' remains
   as '2' internally.



Attributes
----------

.. autoapisummary::

   anki.scheduler.v3.QueuedCards
   anki.scheduler.v3.SchedulingState
   anki.scheduler.v3.SchedulingStates
   anki.scheduler.v3.SchedulingContext
   anki.scheduler.v3.SchedulingStatesWithContext
   anki.scheduler.v3.SetSchedulingStatesRequest
   anki.scheduler.v3.CardAnswer


Classes
-------

.. autoapisummary::

   anki.scheduler.v3.Scheduler


Module Contents
---------------

.. py:data:: QueuedCards

.. py:data:: SchedulingState

.. py:data:: SchedulingStates

.. py:data:: SchedulingContext

.. py:data:: SchedulingStatesWithContext

.. py:data:: SetSchedulingStatesRequest

.. py:data:: CardAnswer

.. py:class:: Scheduler(col: anki.collection.Collection)

   Bases: :py:obj:`anki.scheduler.legacy.SchedulerBaseWithLegacy`


   Legacy aliases and helpers. These will go away in the future.


   .. py:attribute:: version
      :value: 3



   .. py:attribute:: reps
      :value: 0



   .. py:method:: get_queued_cards(*, fetch_limit: int = 1, intraday_learning_only: bool = False) -> QueuedCards

      Returns zero or more pending cards, and the remaining counts. Idempotent.



   .. py:method:: describe_next_states(next_states: SchedulingStates) -> collections.abc.Sequence[str]

      Labels for each of the answer buttons.



   .. py:method:: build_answer(*, card: anki.cards.Card, states: SchedulingStates, rating: CardAnswer) -> CardAnswer

      Build input for answer_card().



   .. py:method:: answer_card(input: CardAnswer) -> anki.collection.OpChanges

      Update card to provided state, and remove it from queue.



   .. py:method:: state_is_leech(new_state: SchedulingState) -> bool

      True if new state marks the card as a leech.



   .. py:method:: reset() -> None


   .. py:method:: getCard() -> anki.cards.Card | None

      Fetch the next card from the queue. None if finished.



   .. py:method:: counts(card: anki.cards.Card | None = None) -> tuple[int, int, int]


   .. py:property:: newCount
      :type: int



   .. py:property:: lrnCount
      :type: int



   .. py:property:: reviewCount
      :type: int



   .. py:method:: nextIvlStr(card: anki.cards.Card, ease: int, short: bool = False) -> str

      Return the next interval for CARD as a string.



   .. py:method:: answerCard(card: anki.cards.Card, ease: Literal[1, 2, 3, 4]) -> anki.collection.OpChanges


   .. py:method:: nextIvl(card: anki.cards.Card, ease: int) -> anki.consts.Any

      Don't use this - it is only required by tests, and will be moved in the future.



   .. py:property:: active_decks
      :type: list[anki.decks.DeckId]



