Comment by entropie

Comment by entropie 14 hours ago

13 replies

Pretty OT: A few month ago I tried to marry my simple note system with anki. My goal was to be able to send simple front/backside cards to an api and it would get integrated and I can use it immediately. Ofc, when I edit cards via my notes-backend, the cards in anki should update too.

Long story short: not possible with anki. It took like an entire day for me to realize its just not possible without diving deep into ankis sqlitedb and having the client installed on my server to interact in a horrible way with decks. I wrote my own space repetition [1] backend in a week and never looked back to anki. Ill intergrate FSRS in my software.

1: https://github.com/entropie/ha2itat/tree/main/plugins/entrom...

yellow_lead 14 hours ago

I looked into this before too. Ankiweb (the place where cards created on Anki sync to) does not provide a rest API. The service is free though. It makes sense they may not want automated clients.

There is an implementation of their sync server, which you can self host. And it has a REST API

https://github.com/dsnopek/anki-sync-server

I think I ran into a blocker with it not supporting something I needed last time I tried to use it though.

jwrallie 13 hours ago

Anki can import .csv files and if one of the column content is matching an existing item, it will update the contents of the card while keeping the repetition history. Think of it like including a column with unique keys.

I know this is not precisely what you wanted, but yes, Anki can update card contents.

rsanek 12 hours ago

i use the python package genanki to accomplish this. I've found it to be extremely dependable -- just use the first field as a UUID and you're golden (future imports dedupe and auto update imported cards with the same first field)

johanyc 14 hours ago

Every anki card is just a webview. Its very possible to call an api

  • entropie 14 hours ago

    Then you should be able to link me to some docs.

    • david_allison 13 hours ago

      > In Anki, templates are written in HTML, which is the language that web pages are written in. The styling section is CSS, which is the language used for styling web pages.

      https://docs.ankiweb.net/templates/intro.html

      ----

      But you'd want AnkiConnect, or a Python-based addon for your workflow

    • criddell 12 hours ago

      Have you looked into any of the open source clients to see how they are communicating with the server?

      • entropie 12 hours ago

        I did that. The consens is like, just an example, yanki-connect:

        > Anki desktop app auto-launch > Perhaps the most precarious aspect of the Anki-Connect add-on is that the Anki desktop application must be running for any of the API calls to work. Yanki Connect tries to sand down this rough edge by (optionally) automatically launching the Anki desktop app if it's not running already.

        • [removed] 6 hours ago
          [deleted]
welder 14 hours ago

Edit: nevermind

  • entropie 14 hours ago

    Iam not sure what you are trying to tell me. Do you think I didnt use the original anki software? I think I have never heard of "AnkiApp" before.