anki icon indicating copy to clipboard operation
anki copied to clipboard

Minor changes

Open tkrajina opened this issue 8 years ago • 3 comments
trafficstars

This pull request contains 3 minor changes.

  • Added functions Collections(), Notes() and Cards() are now originally on DB, and the original functions at Apkg are just calling them. The desktop client keeps everything in the database, not in .apkg files and this allows for reading (and eventually manipulating) data directly.
  • exposes the "\x1f" delimiter
  • added a function that allows opening the original database, not a temporary clone (OpenOriginalDB()).

tkrajina avatar Sep 23 '17 05:09 tkrajina

Hey, thanks for your feedback.

So, I have two small side project which both need to read one mf my anki decks. But don't have the .apkg files, I'm reading directly from the files the desktop Anki app uses (in  ~/Library/Application Support/Anki2/ProfileName). The database there is just a file, not zipped in an .apkg/zip archive. And that's why I needed a possibility to open the database directly.

Ideally, the library would work regardless if you open an .apkg file or the extracted directory, but after looking at the code I realised it would be simpler to just add those helper methods in *Db.

For files. No, I don't have plans to read files, but I do add audio files to my decks. An API for doing that would be cool, but I got it to work even without that.

BTW, You can see here how it works. Remember, this is just a quick weekend project and the code is not really high quality, but it works :)

tkrajina avatar Sep 23 '17 12:09 tkrajina

Ah, and one more thing. I have a plan to create another small open source tool which will allow me to:

  • extract the cards from a deck to a github repository (probably a json or a yml file)
  • create a LaTeX/PDF/README document from all the decks. Specifically, I want to create a downloadable dictionary from words in my Anki Deck.
  • allow users to edit the list in the github repository, send the changes as pull requests, and the tool should sync those changes back to the deck.

So, I'll probably need a better way to edit notes. As you can see in the code I already succeeded in doing it (although the code is still very ugly), but a simpler API for doing it would be a nice addition. What do you think?

PS. Thanks for your great work on the library!

tkrajina avatar Sep 23 '17 12:09 tkrajina

I have a plan to create another small open source tool which will allow me to:

That sounds like a very interesting project... good luck! I'd love to see the finished product.

PS. Thanks for your great work on the library!

No problem; I'm glad someone else found it useful.

flimzy avatar Sep 23 '17 13:09 flimzy