Skip to content

Instantly share code, notes, and snippets.

@phu54321
Last active February 7, 2019 09:50
Show Gist options
  • Save phu54321/3b857fcd4a198926d3ba1aaa44695cce to your computer and use it in GitHub Desktop.
Save phu54321/3b857fcd4a198926d3ba1aaa44695cce to your computer and use it in GitHub Desktop.
How to create a revlog from Anki:
import os
with open(os.path.expanduser('~/Desktop/revlog.csv'), 'w') as f:
f.write('id,cid,usn,ease,ivl,lastIvl,factor,time,type\n')
for row in mw.col.db.execute('select * from revlog'):
f.write(str(row)[1:-1])
f.write('\n')

Dumping study log (Windows & Mac users)

  1. Run anki's console with Ctrl+:
  2. On a console window, paste the code (import os ~~~~~ write('\n') on the top white box, and type Ctrl+enter
  3. File called revlog.csv would be at your desktop. Upload that file.

For privary-concerned: What revlog.txt does.

revlog.csv has these as a content, as indicated here.

  • id: Time you did the review
  • cid: Time you made the card. Unique for each card.
  • usn: Some metadata used for AnkiWeb sync. It tells which data is newer, on web or on your PC.
  • ease: What button you pressed. Again/Hard/Normal/Easy
  • ivl: Next interval of the card. (You should wait for interval time to study the card again)
  • lastIvl: Previous interval of the card
  • factor: SM-2 algorithm related thing
  • time: Time spent for each review.
  • type: Type of review (new card? learn? relearn? cram?)

There aren't anything privacy-related I think. It may reveal the time you do study the most, the time you create the card the most. That's all I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment