{"id":15945699,"url":"https://github.com/ig3/anki-limitnew","last_synced_at":"2026-01-21T11:02:04.201Z","repository":{"id":77186252,"uuid":"248565879","full_name":"ig3/anki-limitnew","owner":"ig3","description":"Limit the number of new cards in Anki","archived":false,"fork":false,"pushed_at":"2021-08-31T06:24:23.000Z","size":211,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T11:19:16.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ig3.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-19T17:34:51.000Z","updated_at":"2023-05-20T17:43:34.000Z","dependencies_parsed_at":"2023-09-04T12:03:47.846Z","dependency_job_id":null,"html_url":"https://github.com/ig3/anki-limitnew","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ig3/anki-limitnew","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ig3%2Fanki-limitnew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ig3%2Fanki-limitnew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ig3%2Fanki-limitnew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ig3%2Fanki-limitnew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ig3","download_url":"https://codeload.github.com/ig3/anki-limitnew/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ig3%2Fanki-limitnew/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-07T09:05:37.972Z","updated_at":"2026-01-21T11:02:04.176Z","avatar_url":"https://github.com/ig3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Note: I have stopped using Anki. I now use\n[srf](https://github.com/ig3/srf) instead. It provides a small subset of\nAnki features but the scheduler regulates new cards automatically, to\nmaintain a steady workload without constant manual adjustments, and cards\nwith shorter intervals are prioritized over cards with longer intervals,\nwhich I find significantly enhances learning, particularly with a backlog\n(e.g. after a few days without study). As I am not using Anki, I will not\nnotice if a newer version of Anki is incompatible with this plugin and will\nhave little motivation to adapt the plugin. If anyone wants to continue\ndevelopment, of course you can fork this repository and I would be happy to\ngive over the plugin page on ankiweb. Let me know if you are interested.\n\n# anki-limitnew\nLimit the number of new cards in Anki based on workload.\n\nIf you have too many cards due, you cannot study them all on schedule. This\ndefeats the spaced repitition schedule. Adding more new cards only makes\nthe problem worse. You can manually edit your new card limit but this\nadd-on adjusts it automatically to keep a steady workload, adding as many\nnew cards as you can handle without being overloaded.\n\nThis add-on works only with Anki 2.1 and the V2 scheduler.\n\nThere are three implementations:\n1. The original implementation for Anki 2.1.22\n2. An implementation for Anki 2.1.22 through 2.1.27\n3. The latest implementation for Anki 2.1.28\n\n## Installation\n\n* Download limitnew.ankiaddon\n* Start Anki and open Tools -\u003e Add-ons\n* Drag the downloaded .ankiaddon file onto the add-ons list\n* Restart Anki\n\nGitHub: https://github.com/ig3/anki-limitnew\n\n## Concepts\n\nIdeally, you will complete study of all due cards every day. If you do, you\nwill see your review cards according to the spaced repition algorithm. If\nyou don't, your reviews of some cards will be delayed and learning will not\nbe as effective. If you are unable to study for a few days, you may have\nmore reviews due than you can complete in a day and adding more new cards\nwill only make the problem worse. You need some time without any more new\ncards to catch up, then you can study new cards again. Otherwise, you may\nbe perpetually overloaded and not learning effectively, going into a\ndownward spiral of failure.\n\nEach deck has a limit on new cards per day. This is a fixed number and if\nyou complete your study each day, you will see this number of new cards\neach day. That's great, as long as you don't get overloaded and fall\nbehind. You make steady progress.\n\nReality is, some cards are easier than others and some days are better than\nothers. On a good day with easy cards, you could study many new cards and\nstill complete all due reviews. On a bad day or with more difficult cards,\nadding too many new cards will make you fall behind and if you have limited\ntime to study, you may not be able to complete all due reviews. If you fall\nbehind for other reasons (i.e. you are unable to study for a few days)\nadding new cards before you are caught up just makes it harder to catch up.\n\nBut Anki shows the same number of new cards every day, regardless of your\nworkload and how well you are coping.\n\nOne simple solution is to set your new card limit to 0 then add new cards\nby custom study. This way you can add as many new cards as you want,\nwhenever you have capacity but not add any when you are overloaded.\nEffectively, you manage the number of new cards manually.\n\nAnother is to edit your deck options to reduce your new card limit when you\nare overloaded and increase it when you are not. Again, you are managing\nthe number of new cards manually.\n\nYet another is to set Anki scheduling options to show new cards after\nreviews. If you don't complete your reviews, you will not see any new\ncards. This is *automatic* but you will see all your new cards together, at\nthe end of your study and each deck is handled separately. If you have\nmultiple decks, you may spend time studying new cards in one deck, then not\nhave time to finish all the cards due when studying a subsequent deck.\n\nWith this add-on you can limit the number of new cards you see based on\nnumber of overdue cards, number of cards scheduled and number of cards\nviewed and you can set limits for the totals of these across all decks\nand for each deck individually. \n\nThe limits work regardless of study order (new cards first, last or mixed\nwith reviews).\n\nIf you are coping well you will not have any overdue cards and the sum of\ncards viewed and scheduled will be below the limits you set. In this case\nyou will see the full number of new cards you have configured as\n`New cards/day` in you options for New Cards.\n\nIf you have overdue cards or the sum of scheduled and viewed cards exceeds\nthe limit you configure for this add-on, then the number of new cards you\nsee will be reduced. The reduction is gradual, reacing zero at the maximums\nyou set. Limits and maximums can be set for each deck and for totals across\nall decks.\n\nThe objective is to studay as many new cards as possible without becoming\noverloaded so that you can complete all scheduled reviews each day. If you\ndo become overloaded, then hold off new cards completely, until you catch\nup with scheduled reviews.\n\nNew cards a limited based on number of overdue cards and `workload`: the\nsum of cards scheduled and cards viewed for the day. This is an\napproximation of the time and effort you are putting in to studying.\n\n**Workload**: the number of cards due to be reviewed plus the number of\ncard views on the day.\n\nIf you view the same card several times (e.g. as it progresses through your\nlearning steps) then each view of the card contributes to workload. The\nworkload is not the number of unique cards, but the total number of card\nviews, regardless of which card. At the start of the day no cards have been\nviewed, but some number of cards are due. By the end of the day, if you\ncomplete review of all cards due, the remaining cards due is 0 but you will\nhave viewed some number of cards. The sum of due and viewed cards the the\napproximation of workload. It tends to increase as you will view hard cards\nmore than once.\n\n**Overdue**: the number of cards overdue for review is simpler. If you\ncomplete all scheduled reviews each day, this number will be 0 but if you\ndon't complete all scheduled reviews then you will accumulate overdue\ncards.\n\n**OverdueMax**: the upper limit on overdue cards, beyond which no new\ncards per day will be reduced to 0.\n\nFor the limit based on overdue cards there is one parameter: `OverdueMax`.\nThe new cards limit is reduced if there are any overdue cards. It is\nreduced gradually, down to 0 when the number of overdue cards exceeds\n`OverdueMax`. For example, if New cards/day is 20 and OverdueMax is 10,\nthen if you have 0 overdue cards you may see 20 new cards but if you have 5\noverdue cards you may only see 10 new cards and if you have 10 or more\noverdue cards you will not see any new cards.\n\nFor the limit based on workload there are two parameters: WorkloadLimit and\nWorkloadMax. The new cards limit is reduced if the workload exceeds\nWorkloadLimit. It is reduced gradually, down to 0 when the workload exceeds\nWorkloadMax. Depending on your preference, WorkloadLimit and WorkloadMax\ncan be set equal for an abrupt cutoff of new cards, or WorkloadMax can be\nset greater than WorkloadLimit for a gradual reduction.\n\n**WorkloadLimit**: the lower limit, beyond which new cards per day begins\nto be reduced from its configured value.\n\n**WorkLoadMax**: the upper limit, beyond which the new cards per day is\nreduced to 0.\n\n## Configuration\n\nThe add-on has the following configuration parameters:\n\n   * enableDeckLimits\n   * enableTotalLimits\n   * mode\n   * totalWorkloadLimit\n   * totalWorkloadMax\n   * totalOverdueMax\n   * totalMinimumNew\n   * defaultDeckWorkloadLimit\n   * defaultDeckWorkloadMax\n   * defaultDeckOverdueMax\n   * defaultDeckMinimumNew\n\nTo change the configuration, start Anki and open Tools -\u003e Add-ons, select\nthe limitnew add-on and click Configure. Set values for the two parameters,\nthen click OK.\n\n### enableDeckLimits - default true\n\nThis parameter may be set to true or false.\n\nIf it is true, then new cards are limited per deck.\nThree new parameters are added to the New tab of deck options:\n\n   * Workload Limit\n   * Workload Max\n   * Overdue Max\n\nThese parameters are configured per option group. Each deck has an option\ngroup configured. By creating multiple option groups, each deck can be\nconfigured differently.\n\nThese parameters work as described above but the workload and overdue cards\nare calculated separately for each deck. If decks are nested, then the\ncalculations include cards overdue, due and studied for a deck and its\nsub-decks.\n\n\n### enableTotalLimits - default true\n\nThis parameter may be set to true or false.\n\nIf it is true then new cards are limited based on total workload: the sum\nof cards due and studied across all decks, and total number of overdue\ncards.\n\nThe limits are configured in add-on configuration parameters\ntotalWorkloadLimit, totalWorkloadMax and totalOverdueMax. These work as\ndescribed above.\n\n### mode - default min\n\nThis parameter is only used by the older implementations. Implementation\nfor Anki 2.1.28 and later ignores it.\n\nThis parameter may be set to min or max.\n\nIf both enableDeckLimits and enableTotalLimits are true, then this\nparameter determines whether the number of new cards for a given deck is\nthe maximum of the two limits or the minimum of them.\n\nThis parameter only works for the older implementations. For the current\nimplementation (Anki 2.1.28 and later) the number of new cards is always\nthe minimum.\n\n### totalWorkloadLimit - default 200\n\nThis parameter may be set to an integer.\n\nIf enableTotalLimits is true, this is the total workload beyond which the\nnew card limit will be reduced. The total workload is calculated by summing\nthe cards studied and reviews and learning cards scheduled across all\ndecks.\n\nRecommendation: Set workloadLimit to the number of cards you can study\nin a couple of hours, or however much time you have available to study each\nday. If you need only a few seconds per card, you might set your limit to\n2,000 or higher. If you spend more like 30 seconds per card, then you might\nset your limit to about 200.\n\n\n### totalWorkloadMax - default 250\n\nThis parameter may be set to an integer.\n\nIf enableTotalLimits is true, this is the workload beyond which the new\ncard limit will be reduced to totalMinimumNew. The total workload is\ncalculated by summing the cards studied and reviews and learning cards\nscheduled across all decks.\n\nIf workloadMax is greater than workloadLimit then the new\ncard limit will be gradually reduced as workload increases from\nworkloadLimit to workloadMax.\n\nRecommendation: Set totalWorkloadMax to the workload beyond which you don't\nwant to see any new cards. If you want your new cards to be all-or-nothing,\nset totalWorkloadMax to the same value as totalWorkloadLimit.\n\n### totalOverdueMax - default 20\n\nThis parameter may be set to an integer.\n\nIf enableTotalLimits is true, this is the number of overdue cards beyond\nwhich the new card limit will be reduced to totalMinimumNew.\n\nRecommendation: Set totalOverdueMax low. You will only have overdue cards\nif you fail to study all scheduled reviews. This is a strong indicator that\nyou are overloaded, in which case adding more new cards will not be\nhelpful.\n\n### totalMinimumNew - default 1\n\nThis parameter may be set to an integer.\n\nIf enableTotalLimits is true, this is the minimum that new cards will be\nreduced to based on total workload and overdue cards.\n\nRecommendation: Set this to the number of new cards you want to see every\nday, regardless of your overall workload. It should be low enough that even\nwhen you are seriously overloaded, you will be able to recover reasonably\nquickly.\n\n### defaultDeckWorkloadLimit - default 200\n\nThis parameter may be set to an integer.\n\nIf enableDeckLimits is true, this is the default value of the option group\nWorkload Limit parameter.\n\n### defaultDeckWorkloadMax - default 250\n\nThis parameter may be set to an integer.\n\nIf enableDeckLimits is true, this is the default value of the option group\nWorkload Max parameter.\n\n### defaultDeckOverdueMax - default 20\n\nThis parameter may be set to an intenger.\n\nIf enableDeckLimits is true, this is the default value of the option group\nOverdue Max parameter.\n\n### defaultDeckMinimumNew - default 1\n\nThis parameter may be set to an integer.\n\nIf enableDeckLimits is true, this is the default value of the option group\nMinimum New parameter.\n\n## Per-Deck Limits\n\nIf `enableDeckLimits` is set to true, then deck options will include three\nnew parameters: `Workload Limit`, `Workload Max`, `Overdue Max` and\n`Minimum New`. These values will not appear in the add-on configuration\nfile. They only appear in the deck options. They work the same as the\ncorresponding `total` parameters in the add-on configuration, except the\nworkload and overdue cards are for the partucular deck. However, if you\nhave nested decks, then the number for the parent deck include those of the\nsub-decks.\n\n## Custom Study - increase today's new card limit\n\n[Custom study](https://docs.ankiweb.net/#/filtered-decks?id=custom-study)\nallows you to increase the number of new cards for the day. This alters\nthe deck, rather than creating a filtered deck. The implementation doesn't\nactually change the new card limit. Instead, it adjusts the count of new\ncards studied. If you allow 10 more new cards, the new card limit is\nunchanged but the count of new cards studied is reduced by 10, possibly to\na negative number. Then, as you study more new cards, the count of new\ncards studied is increased. You can study more new cards until the count\nreaches the new card limit.\n\nWhen your workload is less than your WorkloadLimit, this should work as\nexpected but when the add-on has reduced your new card limit, the result\ncan be a bit confusing.\n\nConsider if your new card limit is 20 cards and you study 20 new cards.\nWith the older implementations, your count of new cards is 20, your limit\nis 20 and Anki will not show you any more new cards. If you continue to\nstudy so that your total number of reviews exceeds your WorkloadMax, then\nthis add-on will reduce your new card limit to 0. Now, your new card limit\nis 0, but your count of new cards is still 20. If you then add 10 more new\ncards by custom study, your new card limit is still 0 and your count of new\ncards is reduced to 10, but 10 is still more than 0 so you will not see any\nmore new cards. If you then allow another 15 new cards, your count of new\ncards studied is reduced to -5 (these adjustments are cumulative). Since -5\nis less than 0, you will see 5 more new cards. \n\nThe latest implementation is different. It changes the number of new cards\nyou will see by changing the number of new cards seen, rather than the\nlimit on new cards. Thus, it works consistently with how custom study\nworks: to make Anki believe you have studied more or less new cards than\nyou actually have. Being consistent with how custom study works, it will,\nhopefully, be a little less confusing if you do custom study.\n\n## Filtered decks\n\n[Filtered decks](https://docs.ankiweb.net/#/filtered-decks?id=filtered-decks-amp-cramming)\nare for study outside the normal spaced repitition algorithm and deck\nconfiguration.\n\nThis add-on does not limit new cards in filtered decks. This includes\nfiltered decks you create manually and those created by custom study.\n\nFiltered decks do have reviews due and studying a filtered deck contributes\nto the count of card views - increasing the total workload for the day.\nThis will not affect per-deck limits (assuming the filtered deck is not a\nsub-deck of the deck being studied) but it will affect the limits based on\ntotal workload.\n\n## Sub-decks\n\nThe new card limit of a sub-deck cannot be more than the limit of its\nparent deck. This limitation is imposed by the Anki v2 scheduler. This is\ntrue even if one studies only the sub-deck. This add-on may reduce the new\ncard limit of the parent deck and as a result limit the new card limit of\nthe sub-deck, regardless of the configuration of the sub-deck.\n\n## Anki versions older than 2.1.22\n\nThe latest implementation uses hook scheduler_new_limit_for_single_deck,\nintroduced with Anki 2.1.22. For older versions, the old monkey patch\nintegration is used. This version of the add-on is much simpler.\n\n### Configuration\n\nThe old implementation has only two configuration parameters:\n\n   * workloadLimit (default 200)\n   * workloadMax (default 250)\n\nThese are applied to workload calculated across all decks. There is no\nsupport for per-deck workload limits.\n\nFor example, you can set configuration to:\n\n```\n{\n  \"workloadLimit\": 200,\n  \"workloadMax\": 250\n}\n```\n\nAny other configuration parameters will be ignored.\n\n\n## Change Log\n\n### 09 Jun 2021\n\nSome improvements to the calculations of workload and adjustment of new\ncards from Issue #5 with many thanks to JazzyJangles for testing and\npointing out problems. Still not perfect but about as good as it will get\nwith the limitations of Anki, and certainly better than previous. This\nstill has a lot of prints for debugging.\n\n### 28 May 2021\n\nPossibly fix a bug during load. Anki sometimes calls the\nreviewer_did_answer_card hook before the collection has loaded (i.e. before\ncalling the collection_did_load hook. In this case, the add-on is not\ninitialized and per-deck configuration is not yet available. In this case,\nreturn without doing anything if reviewer_did_answer_card hook is called.\n\n### 22 May 2021\n\nFix a bug in previous release that reduced new cards to 0 in many cases.\n\nAdd options to set a minimum on how low new cards will be reduced.\n\n### 14 May 2021\n\nA new implementation that works with Anki 2.1.28 and later.\n\nAdded limit on overdue cards as an alternative basis for limiting new\ncards. Having overdue cards is a strong indication that you are overloaded.\nWhile your number of scheduled and viewed cards are likely to be high in\nsuch a case, you might want to limit new cards purely on the basis of\noverdue cards, regardless of workload.\n\n### 2 Sep 2020\n\nComment out print statements.\n\n### 31 Aug 2020\n\nA major rewrite to address some performance issues.\n\nFor Anki 2.1.22 and later, the scheduler_new_limit_for_single_deck hook is\nused for integration.  Neither _groupChildrenMain nor _deckNewLimitSingle\nare monkey patched. For older versions of Anki, the old implementation is\nstill used - monkey patching _groupChildrenMain and _deckNewLimitSingle.\n\nThe new implementation supports workload limits per deck, with\nconfiguration in deck options, and total workload limit with configuration\nin add-on options.\n\nDatabase queries to determine workload (cards due and cards studied) are\nrewritten to improve performance and results are cached to avoid re-running\nthem unnecessarily. The cache is cleared when cards are reviewed.\n\n#### hooks\n\n##### scheduler_new_limit_for_single_deck\n\nThis pylib hook is used to reduce the limit on new cards per deck, based on\nworkload.\n\n##### reviewer_did_answer_card\n\nThis GUI hook is used to clear the cache of number of cards due and studied\nwhen a card is answered. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fig3%2Fanki-limitnew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fig3%2Fanki-limitnew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fig3%2Fanki-limitnew/lists"}