GithubHelp home page GithubHelp logo

kobo-annot-import's Introduction

With Kobo e-Reader we can highlight EPUB book as annotation that will be kept in the reader storage as XML files.

This Python script uses combination of find,rsync, and grep to extract the annotations and save them as individual Markdown file using the annotation text (in my case as sort of title) for naming.

I'm using Mac OSX so, plugging my Kobo Clara HD will mount it to /Volumes/KOBOeReader. I use one line where:

  1. I change dir to the e-Reader (cd)
  2. find annotation files
  3. Compare those files whether they are newer or the same with the ones kept on my laptop
  4. Copy only newer files to my laptop (rsync)
  5. Pipe the list of these newer files for processing the XML into individual markdown files

cd /Volumes/KOBOeReader && find ./ -name "*.annot" -type f -print0 2>/dev/null | rsync -av --files-from=- --from0 --no-relative /Volumes/KOBOeReader <directory where I keep my XML files on my laptop> | grep annot | /<pyenv-version>/python kobo-annot-import.py

In the Python script I still initiate folder for XML and markdown files.

# Define annotation folder
annot_folder = '' # replace with annotation local folder
# Define result folder root
folder_name = 'result' # replace with target folder

It will check whether same markdown with the name Some-Annotation-Text-as-Title-example.md exists and prevent from overwriting it, assuming the one on the laptop has already been modified. It will then append to Some-Annotation-Text-as-Title-example (1).md if content doesn't match newer annotation.

This is a work in progress. Always backup properly if not sure on result.

kobo-annot-import's People

Contributors

bandono avatar

Watchers

 avatar

kobo-annot-import's Issues

When creating newer annotation on KOBO same UUID maybe used again

Duplicate UUIDs were found to have different annotation content. So can't safely use UUID as file name of the generated annotation file.

Here is example UUID case: 93b5dc68-f29c-40a6-9d85-e478e26f7988

Since this is beyond us as user, simply just change naming to use other than UUID.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.