Skip to main content

Free Spaced Repetition Scheduler

Project description

About The Project

PyPi Code style: black

Py-fsrs is a Python Package implements Free Spaced Repetition Scheduler algorithm. It helps developers apply FSRS in their flashcard apps.

Getting Started

pip install fsrs

Usage

Create a card and review it at a given time:

from datetime import datetime, UTC
from fsrs import *
f = FSRS()
card = Card()
# (py-fsrs cards use UTC)
now = datetime(2022, 11, 29, 12, 30, 0, 0, tzinfo=UTC) 
scheduling_cards = f.repeat(card, now)

There are four ratings:

Rating.Again # forget; incorrect response
Rating.Hard # recall; correct response recalled with serious difficulty
Rating.Good # recall; correct response after a hesitation
Rating.Easy # recall; perfect response

Get the new state of card for each rating:

scheduling_cards[Rating.Again].card
scheduling_cards[Rating.Hard].card
scheduling_cards[Rating.Good].card
scheduling_cards[Rating.Easy].card

Get the scheduled days for each rating:

card_again.scheduled_days
card_hard.scheduled_days
card_good.scheduled_days
card_easy.scheduled_days

Update the card after rating Good:

card = scheduling_cards[Rating.Good].card

Get the review log after rating Good:

review_log = scheduling_cards[Rating.Good].review_log

Get the due date for card:

due = card.due

There are four states:

State.New # Never been studied
State.Learning # Been studied for the first time recently
State.Review # Graduate from learning state
State.Relearning # Forgotten in review state

License

Distributed under the MIT License. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fsrs-2.1.0.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

fsrs-2.1.0-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page