Hi, I have dockerized anki-sync-server (via PyPi package) and run it on my Raspberry Pi. It syncs perfectly with AnkiDroid!
I want to go further and make changes to my collection programmatically. I know that the sync server can only sync, so there is no endpoint like add new note. So my plan is to download the collection, patch it, and send it back.
But I’m stuck even with authentication. There is no API documentation, the implementation is Rust-based, and even with the help of LLMs, I don’t understand what my requests should look like…
I have checked this plugin, but it cannot be installed and run on a server like a Raspberry Pi, as far as I understand.
My idea is to have a workflow that gets, for example, a word, generates a note from it with the help of AI, and adds it to a deck. The workflow can be triggered in different ways, by a message to a Telegram bot or by submitting a form.
Is it possible to write a python script to call anki’s pylib, or directly operate the sqlite database, and run a web server of your own to build a workflow with other tools? This is just a preliminary idea and has not been verified.
It runs a whole client (Anki Desktop) in a docker container. With AnkiConnect, you basically have an API to add new cards programmatically which will then sync with other devices.