Is there a way to get data from Anki while not running?

I am trying to create a widget (GitHub - elkowar/eww: ElKowars wacky widgets) with a heatmap of Anki on Linux. However, I am not sure where to start. Is there an easy way to get hold of the streak data somehow through the command line? Some hidden API maybe?

1 Like

You can use the collection API: Command-Line Use - Writing Anki Add-ons

2 Likes

see also the README in the same repo for an overview.

1 Like

following this! Will you share your widget? Can I help contribute? Thanks!

I actually want to make a duolingo-widget style streak counter for my desktop.

Edit: This sent me into a deep rabbit hole i am not very proud of. My current implementation is using Conky through ankiconnect. Caching the result to a file then running a script to periodically update said file.

I also explored using the Review Heatmap addon to generate said cache but I’m too normie to come up with a solution by modifying said addon

1 Like

Wow, thank you guys for the relevant info. I wanted to write the backend in Rust, specifically, Tauri. I will probably still write it in Rust, since I want it to be as lightweight on CPU cycles as possible, and I am not sure if I will be able to react to changes to the .anki2 SQLite file or if I will have to revert to the good ol’ polling method every 5 minutes or so.

@gnx I am really glad someone showed interest! : )
I can totally open-source the repo and post a link here, for anyone interested. I am now however in the middle of an exam period, so I will start the development in a week or two. I will message you once I make the repo public.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.