databasesqliteanki

Access Anki history from SQLite3 file


I want to perform some data analysis of my own on my Anki history.

I found out that my history should be contained in ~/.local/share/Anki2/User 1/collection.anki2.
The file info says that this file is of type SQLite3 database (application/vnd.sqlite3).

How can I open this file? (Could be with Python or with some dedicated software)

PS: I am clueless about database-related stuff


Solution

  • You can open collection.anki2 with sqlite3(CLI) or sqlitebrowser(GUI)

    For example, the database from the apkg archive

    user@debian:~/Documents/anki$ sqlite3 collection.anki2
    SQLite version 3.27.2 2019-02-25 16:06:06
    Enter ".help" for usage hints.
    sqlite> .tables
    cards   col     graves  notes   revlog
    sqlite> .exit