What does HackerNews think of genanki?
A Python 3 library for generating Anki decks
I see your project uses import-from-csv to get cards into Anki -- you can make this significantly more user-friendly by utilizing the genanki Python package [0]. It spits out an apkg for you that you can just double-click on and import. The other side benefit is that you can keep a stable ID of the same cards over time, which means that if you want to eg update the structure or styling of already-exported notes, it is very easy to do so.
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.