/rs-fsrs

Rust-based Scheduler for FSRS

Primary LanguageRustMIT LicenseMIT

rs-fsrs

A rust implementation of FSRS scheduler.

Install:

[dependencies]
fsrs = { git = "https://github.com/open-spaced-repetition/rs-fsrs" }
chrono = { version = "0.4.23", features = ["serde"] }

Quickstart:

use chrono::Utc;
use fsrs::{FSRS, Card, Rating};

fn main() {
    let fsrs = FSRS::default();
    let card = Card::new();

    let scheduleing_card = fsrs.repeat(card, Utc::now());
    for rating in Rating::iter() {
        let item = scheduleing_card.get(rating).unwrap().to_owned();
        println!("{:?}", item.card);
        println!("{:?}", item.review_log);
    }
}

Development

run

cargo fmt
cargo clippy -- -D clippy::nursery
cargo test --release

Other implementation

fsrs-rs contains a Rust API for training FSRS parameters, and for using them to schedule cards.

Bindings

LICENSE

MIT