FSRS.Core
1.0.7
dotnet add package FSRS.Core --version 1.0.7
NuGet\Install-Package FSRS.Core -Version 1.0.7
<PackageReference Include="FSRS.Core" Version="1.0.7" />
<PackageVersion Include="FSRS.Core" Version="1.0.7" />
<PackageReference Include="FSRS.Core" />
paket add FSRS.Core --version 1.0.7
#r "nuget: FSRS.Core, 1.0.7"
#:package FSRS.Core@1.0.7
#addin nuget:?package=FSRS.Core&version=1.0.7
#tool nuget:?package=FSRS.Core&version=1.0.7
FSRS.Core
A .NET implementation of the Free Spaced Repetition Scheduler (FSRS) algorithm with full dependency injection support.
This is C# version of py-fsrs
What is FSRS?
FSRS (Free Spaced Repetition Scheduler) is a modern, open-source spaced repetition algorithm that helps optimize memory retention. It's designed to be more accurate and efficient than traditional algorithms like SM-2.
Features
- ✅ Complete FSRS algorithm implementation
- ✅ Dependency injection support
- ✅ Configurable parameters and settings
- ✅ Comprehensive unit tests
- ✅ Easy integration with existing applications
- ✅ Target frameworks (.NET 8)
Installation
dotnet add package FSRS.Core
Quick Start
Basic Usage
using FSRS.Core.Models;
FSRS
using FSRS.Core.Services;
// Create a scheduler with default settings
var scheduler = new Scheduler();
// Create a new card
var card = new Card();
// Review the card
var (updatedCard, reviewLog) = scheduler.ReviewCard(card, Rating.Good);
Console.WriteLine($"Next review: {updatedCard.Due}");
Console.WriteLine($"Stability: {updatedCard.Stability}");
With Dependency Injection (ASP.NET Core)
using FSRS.Core.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Add FSRS services
builder.Services.AddFsrs(options =>
{
options.DesiredRetention = 0.9;
options.MaximumInterval = 365;
});
var app = builder.Build();
[ApiController]
public class CardsController : ControllerBase
{
private readonly IScheduler _scheduler;
public CardsController(IScheduler scheduler)
{
_scheduler = scheduler;
}
[HttpPost("review")]
public ActionResult ReviewCard([FromBody] ReviewRequest request)
{
var card = new Card(request.CardId);
var (updatedCard, reviewLog) = _scheduler.ReviewCard(card, request.Rating);
return Ok(updatedCard.ToDictionary());
}
}
Configuration Options
builder.Services.AddFsrs(options =>
{
options.Parameters = customParameters; // Custom FSRS parameters
options.DesiredRetention = 0.85; // Target retention rate
options.MaximumInterval = 36500; // Maximum interval in days
options.EnableFuzzing = true; // Enable interval fuzzing
options.LearningSteps = [ // Learning steps
TimeSpan.FromMinutes(1),
TimeSpan.FromMinutes(10)
];
options.RelearningSteps = [ // Relearning steps
TimeSpan.FromMinutes(10)
];
});
Documentation
For complete documentation, examples, and API reference, visit: GitHub Repository
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.0.0:
- Initial release of FSRS.Core
- Full FSRS algorithm implementation
- Dependency injection support
- Comprehensive unit tests
- Support for custom parameters and configurations