Quickstart: Initialize scheduler and review a card
mainTo use Py-FSRS, initialize a Scheduler, create a Card (which is due immediately upon creation), and use scheduler.review_card() with a Rating to update the card's state and get a ReviewLog.
from fsrs import Scheduler, Card, Rating, ReviewLog
scheduler = Scheduler()
# NOTE: all new cards are due immediately upon creation
card = Card()
# Rating.Again (==1) forgot the card
# Rating.Hard (==2) remembered the card with serious difficulty
# Rating.Good (==3) remembered the card after a hesitation
# Rating.Easy (==4) remembered the card easily
rating = Rating.Good
card, review_log = scheduler.review_card(card, rating)
print(f"Card rated {review_log.rating} at {review_log.review_datetime}")