Anki data basically needs wrapper libraries with a humane API, even when working with low-level structures (i.e. without the app itself running). Just to avoid traumatizing external developers.

If everyone is using such libraries, the structure itself can be changed.

100%

The AnkiConnect project[1] is about the closest that we get to that right now, but requires running everything through a server inside Anki.

[1]: https://github.com/FooSoft/anki-connect

Not needing Anki itself is pretty much a requirement for me, because that's the way which makes sense in my worldview. Tools work independently and feed into each other—not get slapped onto each other, which kinda smells like a whiff of bad OOP.

I began a feeble attempt at a lib for my own purposes, but I had to take Anki db structs a little at a time just to keep my frustration in check.

There are in fact some libs for writing Anki data: https://github.com/kerrickstaley/genanki and maybe https://github.com/patarapolw/AnkiTools — but genanki, while looking quite good for one-time generation, doesn't seem to be able to update notes.

Afaik Anki itself does include Python libs for creating and manipulating db records, which can be used in third-party scripts—however dunno if they work without the full app running, and on top of that I personally keep trying to use Lua, since it runs circles around Python in terms of speed.