View Single Post
Old 05-07-2013, 03:19 PM   #5
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 583
Karma: 1258323
Join Date: Dec 2011
Location: Padova, Italy
Device: Kindle3, Odyssey, eDGe, A60, PRS-T1, iPad3, KoboGlo
Hi all,

here you can find a Python 2.x script to extract the annotations and highlights from an .annot file generated by the Odyssey.

You need Python 2.x and python-lxml installed. Confirmed to work under Linux and Windows.

Usage:
Code:
$ python export_Odyssey_notes.py [ARGUMENTS]

Arguments:
 -h, --help          : print this usage message and exit
 -f, --file <file>   : <file> is the path to .annot file
 -c, --csv           : output CSV values, instead of human-readable strings
 -o, --output <file> : write output to <file>

Exit codes:

 0 = no error
 1 = invalid argument(s) error
 2 = specified file not found
 4 = provided file is not a valid .annot file
 8 = output file cannot be written

Examples:

 1. Print this usage message
    $ python export_Odyssey_notes.py -h

 2. Print annotations and highlit passages in human-readable form
    $ python export_Odyssey_notes.py -f ebook.epub.annot

 3. As above, but output to output.txt
    $ python export_Odyssey_notes.py -f ebook.epub.annot -o output.txt

 4. As above, but output in CSV form
    $ python export_Odyssey_notes.py -c -f ebook.epub.annot

 5. As above, but output to output.csv
    $ python export_Odyssey_notes.py -c -f ebook.epub.annot -o output.csv

Last edited by AlPe; 05-11-2013 at 09:02 AM.
AlPe is offline   Reply With Quote