Enhance your learning speed with Spaced Repetition technique. It uses increasing intervals of time between card reviews.
But now you have API. Create cards, organise them into decks, study and actually review.
And there is no session
object to pass it everywhere.
$ pip install spacedr
At first, you need to import the module:
>>> import spacedr
And initialise the database:
>>> spacedr.db_init()
>>> spacedr.create_deck(name='Test Deck', description='Just a test.')
You can get a deck id from a card (which you get using get_cards_to_review
or get_cards_to_study
functions):
>>> deck_id = card.deck_id
And then use this to get the deck
object.
>>> deck = spacedr.get_deck_by_id(deck_id)
>>> spacedr.create_card(deck,
... question='What is the meaning of life?',
... answers=[42, '42'])
You have to update a card each time the user answers.
If answer is right, card's level will be increased, othervise decreased. And the card will be postponed accordingly.
>>> spacedr.update_card(card, answer='43')
You will get a number of cards (limited by ``num``*)*, that haven't been practiced, in the given deck.
>>> spacedr.get_cards_to_study(deck, num=20)
[...]
You will get a number of cards, that need to be reviewed, in the given deck.
>>> spacedr.get_cards_to_review(deck)
[...]
You have to pass name
and description
as keyword arguments:
>>> spacedr.edit_deck(deck, name='test2', description='new one')
You have to pass deck_id
(replace to an another deck), question
and answers
as keyword arguments:
>>> spacedr.edit_card(card, deck_id=deck_id, question='What is life?',
... answers=[42])
The cards assigned to given deck will be deleted too:
>>> spacedr.delete_deck(deck)
>>> spacedr.delete_card(card)
Export the deck from a file descriptor:
>>> with open('mydeck.json', 'w') as file_d:
... spacedr.export_deck(deck, file_d)
Import the deck from a file descriptor:
>>> with open('mydeck.json') as file_d:
... spacedr.import_deck(deck, file_d)
Note
The deck and the cards will be imported as new ones. The old won't be removed.