{"id":17647294,"url":"https://github.com/ap4y/leaf","last_synced_at":"2025-08-09T19:25:50.653Z","repository":{"id":4530516,"uuid":"198336240","full_name":"ap4y/leaf","owner":"ap4y","description":"Flashcard app that uses spaced repetition algorithms for interval calculations","archived":false,"fork":false,"pushed_at":"2023-01-06T02:12:19.000Z","size":1652,"stargazers_count":42,"open_issues_count":14,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T22:31:58.566Z","etag":null,"topics":["flashcards","spaced-repetition","supermemo"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ap4y.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-23T02:27:45.000Z","updated_at":"2024-01-11T22:16:45.000Z","dependencies_parsed_at":"2023-01-11T16:36:07.342Z","dependency_job_id":null,"html_url":"https://github.com/ap4y/leaf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap4y%2Fleaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap4y%2Fleaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap4y%2Fleaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap4y%2Fleaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ap4y","download_url":"https://codeload.github.com/ap4y/leaf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252769132,"owners_count":21801373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flashcards","spaced-repetition","supermemo"],"created_at":"2024-10-23T11:12:00.964Z","updated_at":"2025-05-06T20:46:20.307Z","avatar_url":"https://github.com/ap4y.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"* Leaf\n\n*Leaf* is a flashcard app that uses [[https://en.wikipedia.org/wiki/Spaced_repetition][spaced repetition]]\n algorithm. *Leaf* focuses on simplifying database management, ease of\n access and support for various spaced repetition curves (including\n custom).\n\n[[https://gitlab.com/ap4y/leaf/raw/master/screenshot.png]]\n\n** Getting started\n\n*Leaf* is a [[https://golang.org/][golang]] application and you are going to need golang\ntoolchain to compile the app.\n\nTo install or update run:\n\n#+BEGIN_SRC shell\ngo get -u github.com/ap4y/leaf/cmd/leaf\n#+END_SRC\n\nor\n\n#+BEGIN_SRC shell\ngo get -u github.com/ap4y/leaf/cmd/leaf-server\n#+END_SRC\n\nLeaf provides 2 different versions:\n\n- ~leaf~ is a command line utility that provides review UI in the terminal\n- ~leaf-server~ is a web app that implements review UI along with\n  additional features like stats viewer.\n\nBoth utilities have following configuration options:\n\n- ~-decks .~ is a path to a folder with deck files.\n- ~-db leaf.db~ is a location of a stats DB that contains spaced\n  repetition variables for your decks.\n\nFor ~leaf-server~ you can also adjust address to start server on via ~-addr :8000~.\n\nTerminal CLI (~leaf~) has following commands:\n\n- ~review~ will initiate review session for a deck\n- ~stats~ will return stats snapshots for a deck\n\nBoth commands expect deck name after the command name. Full example:\n\n#+BEGIN_SRC shell\n./leaf -decks ./fixtures review Hiragana\n#+END_SRC\n\n** Database management\n\n*Leaf* uses plain text files structured usin [[https://orgmode.org/manual/Headlines.html#Headlines][org-mode headlines]]. Consider following file:\n\n#+BEGIN_SRC org\n* Sample\n:PROPERTIES:\n:RATER:      auto\n:ALGORITHM:  sm2+c\n:PER_REVIEW: 20\n:SIDES:      answer\n:END:\n** Question 1\nAnswer 1\n** Question 2\nAnswer 2\n#+END_SRC\n\nSuch file will be parsed as a deck named _Sample_ and it will have 2\ncards. For a full deck example check [[https://gitlab.com/ap4y/leaf/raw/master/fixtures/hiragana.org][hiragana]] deck.\n\nYou can use text formatting, images, links and code blocks in your deck\nfiles. Check [[https://gitlab.com/ap4y/leaf/raw/master/fixtures/org-mode.org][org-mode]] deck for an overview of supported options.\n\nTop header level property drawer is used to adjust review\nparameters. Following parameters are supported:\n\n- ~ALGORITHM~ is a spaced repetition algorithm to use. Default is\n  ~sm2+c~. All possible values can be found [[https://gitlab.com/ap4y/leaf/blob/master/stats.go#L35-44][here]].\n- ~RATER~ defines which rating system will be used for\n  reviews. Defaults to ~auto~, supported values: ~auto~ and ~self~.\n- ~PER_REVIEW~ is a maximum amount of cards per review session.\n- ~SIDES~ is an optional field that defines names of the card sides,\n  used in the UI for placeholders.\n\nSpaced repetition variables are stored in a separate file in a binary\ndatabase. You can edit deck files at any time and changes will be\nautomatically reflected in the web app.\n\n** Spaced repetition algorithms\n\n*Leaf* implements multiple spaced repetition algorithms and allows you\nto define new ones. Following algorithms are supported as of now:\n\n- [[https://www.supermemo.com/en/archives1990-2015/english/ol/sm2][supermemo2]]\n- [[http://www.blueraja.com/blog/477/a-better-spaced-repetition-learning-algorithm-sm2][supermemo2+]]\n- Custom curve for supermemo2+. I found it works better for me.\n- [[https://fasiha.github.io/ebisu.js/][ebisu]]\n\nYou can find calculated intervals in corresponding test files. Check\n[[https://gitlab.com/ap4y/leaf/blob/master/stats.go#L9-19][SRSAlgorithm]] interface to define a new algorithm or curve.\n\nPlease keep in mind that algorithm variables may not be compatible\nwith each other and algorithm switching is not supported.\n\n** Review rating\n\nAll reviews are rated using ~[0..1]~ scale. Rating higher than ~0.6~\nwill mark review as successful. You can use 2 different types of\nrating systems:\n\n- ~auto~ (default) is based on amount of mistakes made during review. For ~auto~\n  rating is assigned using [[https://gitlab.com/ap4y/leaf/blob/master/rating.go#L45-47][HarshRater]] which implements steep curve and\n  a single mistake will have score less than ~0.6~. Check [[https://gitlab.com/ap4y/leaf/blob/master/rating.go#L34-36][Rater]]\n  interface to get understanding how to define a different rater\n  curve.\n\n- ~self~ is a self assessment system. You have to assign score for\n  each review and score will be converted to a rating as such: ~hard =\n  0.2~, ~good = 0.6~, ~easy = 1.0~, ~again~ will push card back into\n  the review queue.\n\nTo change rating system for a deck define org-mode property ~RATER~ in\nyour deck file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fap4y%2Fleaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fap4y%2Fleaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fap4y%2Fleaf/lists"}