Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set SRS mastery data #11

Open
holocronweaver opened this issue Aug 6, 2017 · 2 comments
Open

Set SRS mastery data #11

holocronweaver opened this issue Aug 6, 2017 · 2 comments

Comments

@holocronweaver
Copy link
Contributor

holocronweaver commented Aug 6, 2017

I am using genanki to convert data from an SRS app to Anki. I want to translate the SRS mastery data so the Anki items are due roughly when they would have been in the original SRS app.

How can I accomplish this using genanki?

Near as I can tell the fields in Card.write_to_db control this, but I am not sure what the SRS-related fields mean. I guess I will have to look at the Anki source to figure it out. AnkiDroid has some convenient documentation.

I would prefer to set SRS data at the Note level.

I plan to implement this feature, but thought I would ask for some guidance first.

@holocronweaver holocronweaver changed the title Set SRS due dates Set SRS mastery data Aug 6, 2017
@holocronweaver
Copy link
Contributor Author

Further, I would like to customize deck settings, such as learning intervals. If we have a dict of default deck values which can be user customized, then we can simply do APKG_COL.format(values).

@kerrickstaley
Copy link
Owner

Re: the SRS progress data, please add due, ivl, factor, reps, etc. as properties of Card (I'm actually not super familiar with how these affect the SRS algorithm/which fields are relevant). Make them keyword args to init that default to 0, and update Card.write_to_db to use them.

Then, when you instantiate your Note, you can iterate over your_note.cards and update the fields appropriately. You may want to add higher-level helper functions like set_suspended to make it easier to do certain things.

Re: deck settings, feel free to send a PR, I'm also not very familiar with how they work. In general to figure these things out you have to create a dummy deck in the Anki desktop app, tweak the settings you care about, then export it to an apkg, unzip it, and inspect the collection.anki2 file with sqlite. Also don't call .format on APKG_COL, use prepared statements instead (example 8ab8549).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants