simple-spaced-repetition
Simple spaced repetition scheduler, based on the classic Anki algorithm and implemented in under 40 lines of code.
This scheduler is used at Python.cards.
Installation
Install with pip:
pip install simple_spaced_repetition
Example usage
The Card class is what you should use:
>>> from simple_spaced_repetition import Card
>>> Card()
Card(status=learning, step=0, interval=None, ease=2.5)
Card has a single method options() which returns the 4 possible choices for answering a card:
>>> from simple_spaced_repetition import Card
>>> card = Card()
>>> card.options()
[('again', Card(status=learning, step=0, interval=0:01:00, ease=2.5)),
('hard', Card(status=learning, step=1, interval=0:06:00, ease=2.5)),
('good', Card(status=learning, step=1, interval=0:10:00, ease=2.5)),
('easy', Card(status=reviewing, step=0, interval=4 days, 0:00:00, ease=2.5))]
Next to each answer is a new Card object that represents the card after answering with that option.
The attribute interval holds the time that must pass before the card is due again:
>>> from simple_spaced_repetition import Card
>>> card = Card()
>>> for answer, new_card in card.options():
... print(answer, new_card.interval)
again 0:01:00
hard 0:06:00
good 0:10:00
easy 4 days, 0:00:00
Run tests
Simply run:
python test_simple_spaced_repetition.py
Metadata
Release files for simple-spaced-repetition 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| simple_spaced_repetition-0.2.0.tar.gz | 3.2 kB | Without provenance | Details |
Release files / simple_spaced_repetition-0.2.0.tar.gz
| Download URL | simple_spaced_repetition-0.2.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bb3cf9350c2e0268d565401d29e32cdee5e0b17ae97f642ea584b0afb945879
|
|
BLAKE2b-256 checksum How to use checksums |
58b1852482e7533f5f23dcff84eb8fd8a9e0ba27306783fc1829bc7e36818faf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Security for simple-spaced-repetition 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.