Code Monkey home page Code Monkey logo

kindle2anki's Introduction

kindle2anki

Description

This is a Python script to help add words from Kindle to Anki.

Features

  • It can directly add words to Anki decks or creates a anki-ready tsv file.
  • Asks for card back in the terminal (optional).
  • Adds words from both the Vocabulary Builder and your Notes (My Clippings.txt).
  • Last timestamp is written to ~/.kindle. During next import only new lookups are exported. One can manipulate value written to ~/.kindle to get only needed words from Kindle.
  • Retrieve translations, images and sounds from LinguaLeo (from https://github.com/rampage644/kindle-to-anki)

Usage

  • You can my post How I transfer my vocabs from my Kindle Paperwhite to Anki
  • Import new words from vocabulary builder since last time, and asks for card back in the terminal. Words can be skipped (s) or you can quit at any words (q).
    $ ./kindle2anki.py --kindle '/run/media/samim/Kindle/system/Vocabulary/vocab.db' \
       --collection '~/Documents/Anki/User 1/collection.anki2' --deck words --clipboard
    
    [0%]
    Word: include
    Context: Your Kindle includes one or more dictionaries for each supported language.
    Enter card back:[q/s]
        
  • Import new words from notes since last time, do not ask for card back (to edit later in Anki).
    $ ./kindle2anki.py --src '/run/media/samim/Kindle/documents/My Clippings.txt' \
       --collection '~/Documents/Anki/User 1/collection.anki2' --deck words --no-ask
        
  • I have not tested translation (from https://github.com/rampage644/kindle-to-anki)

Install

From AUR or:

  • Install Python 3
  • Clone this repo and init the submodules.
  • Install requirements (pip install -r requirements.txt)

Help

$ ./kindle2anki.py --help

usage: kindle2anki.py [-h] [--kindle KINDLE] [--src SRC]
                      [--collection COLLECTION] [--deck DECK] [-o OUT]
                      [-m MEDIA_PATH] [--email EMAIL] [--update-timestamp]
                      [--pwd PWD] [--max-length MAX_LENGTH] [--verbose]
                      [--no-ask] [--clipboard]

optional arguments:
  -h, --help            show this help message and exit
  --kindle KINDLE       Path to kindle db file (usually vocab.db)
  --src SRC             Path to "documents/My Clippings.txt" on kindle
  --collection COLLECTION
                        Path to anki collection file (.anki file)
  --deck DECK           Anki deck name
  -o OUT, --out OUT     CSV output filename to import into anki, if not
                        provided words are added to provided Anki deck and
                        collection
  -m MEDIA_PATH, --media-path MEDIA_PATH
                        Where to store media files (sounds/images) from
                        Lingualeo
  --email EMAIL         LinguaLeo account email/login
  --update-timestamp    Update local timestamp to now and exit
  --pwd PWD             LinguaLeo account password
  --max-length MAX_LENGTH
                        Maximum length of words from clippings, to avoid
                        importing big sentences
  --verbose             Show debug messages
  --no-ask              Do not ask for card back in the command line
  --clipboard           Copy each word to clipboard

Automatic Sync

One can use udev rules to run this script automatically on Kindle connect. See https://github.com/seletskiy/runki#kindle–udev

Credits

kindle2anki's People

Contributors

psamim avatar

Watchers

 avatar  avatar  avatar

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.