View Single Post
Old 11-28-2015, 01:27 AM   #216
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by bopuc View Post
(For context, I ask because I have built a system for myself* which pulls directly from calibre's SQL database.)
You're extracting the highlighted text and posting them as part of your reviews?
Quote:
"there until next time I fetch annotations" is not a reliable, permanent database. By the looks of it (I have opened the "annotations.db" database in a MySQL viewer), there is a table named "Kindle_Amazon_Kindle_annotations" and it appears to actually hold (mysteriously enough) most if not all of my Kindle annotations ever (I have been meticulous about keeping my My_Clippings.txt around.)

I want to know if the plugin is acting strangely or if the code, by design, keeps and maintains that full record (which would be great!).
The database holds the annotations from the last fetch. The tables are actually dropped and recreated when the fetch is done. This mean that if you don't delete annotations from the device, they will all be there. For me, the annotations are temporary. I mark things I want to fix or check later. Once I do that, I delete them.

The plugin merges whatever is fetched with whatever is in the annotations column. This will work for annotations from different devices. If you are moving the My_Clippings.txt between devices, you should be OK. But, if you started using a Kobo device, it should also be OK, but you wouldn't have the annotation on the device.
Quote:
Now, my limitation is that Python is not a programming language I know and so I do not know what your code is doing.
Python is not a bad language. Though I'm still not used to the idea of not having any delimiters around code blocks.

Quote:
In my case I do not need an export function (because I already have one, one that needs to parse the HTML-encoded annotations through an XML parser), I would simply love it if the plugin took a copy of the data structure of what gets HTML-ified and stuck into the calibre database, JSON-ify it as well and stick that into an adjacent field (in the calibre database). No one needs to see it in the UI necessarily, but having access to it in the DB would be sweet. Well, for me anyways… cough… heh

If you pushed the current revision up to your GitHub repo for the project, I might clone it and try my hand at learning some Python (finally!).
I have just updated the repository. It wasn't missing much, just the changes in the last release.
Quote:
Ideally, if your Annotations plugin can be *the* trusted Annotations importer, formatter and manager for calibre, I think that provides a huge amount of value if some better way of then re-consuming annotations, as I have built for myself*, also becomes available.
I'd like to think it can be trusted. But, there isn't an easy way to get the annotations elsewhere. Because of my usage, I haven't been that interested in doing it. There is code in the plugin to parse the HTML version of the annotation. Using that to produce another format, shouldn't be that hard. Any contributions to the code will be welcome.
davidfor is offline   Reply With Quote