Coder Social home page Coder Social logo

dangbert / clippy-kindle Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 6.0 129 KB

Create Anki flashcards and markdown files from your Kindle notes/highlights.

Home Page: https://www.engbert.me/blog/anki-flashcards-on-kindle/

License: MIT License

Python 100.00%
anki csv kindle markdown

clippy-kindle's People

Contributors

ammarshaqeel avatar dangbert avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

clippy-kindle's Issues

Handle clippings from pdfs with roman numeral pages

Highlights made in the beginning of certain pdf files may record the page number as a roman numeral e.g. 'V'. We need to consider how to handle this:

  • maybe mapping it to a negative number that corresponds to the roman numeral (e.g. -5) in this case, or just to 0.
Parsing file: 'My Clippings.txt'                                                                                                                                                                                                  
ERROR: unable to parse highlight (in unexpected/unsupported format)                                                                                                                                                               
problem section in file (lines 43739 - 43743) >>>                                                                                                                                                                                 
  '2015_Book_IntroductionToEvolutionaryComp  '                                                                                                                                                                                    
  '- Your Highlight on page V-V | Added on Friday, September 9, 2022 1:40:06 AM'                                                                                                                                                  
  ''                                                                                                                                                                                                                              
  'This book has a supporting website at www.evolutionarycomputation.org which ofers additional information'                                                                                                                      
<<<                                                                                                         

Exact section of file causing issue:

2015_Book_IntroductionToEvolutionaryComp  
- Your Highlight on page V-V | Added on Friday, September 9, 2022 1:40:06 AM

This book has a supporting website at www.evolutionarycomputation.org which ofers additional information
==========

Error when attempting to run run clippy.py

Tried running the python script and passed in the .txt file as instructed on the git page & YT video however, I keep encountering this error:

image

Please let me know if there's anything that I can do to resolve the issue

Additional info:
Python 3.91
Kindle PW
Windows 10

Support using Anki API to directly create flashcards

An MVP for this is already complete in the anki branch of this repo, but it's hardcoded with the names/settings of my personal Anki data. The solutions there needs to be generalized as follows:

  • Add support for the following fields in settings.json:
{
        // global settings;
        "user_anki_dir": "~/.local/share/Anki2/User 1",

        // settings for a particular book group:
        "spanish": {
            "deck": "My-cool-deck",
            "tags": ["world::lang::es"],
            // ...
        },
}
  • Refactor ankiImport.py to read from these settings

Error when parsing 'My Clippings.txt' from Windows' WSL

I tried to use your script from an Ubuntu's WSL on Windows. Installed the "pip3 install --user -r requirements.txt" but when going the command ./clippy.py 'My Clippings.txt' it brings the following errors:

ubuntu1804_2CoLcwCvSp

Any idea? Isn't it possible to do from Windows?

Speed up parsing (with caching)

The bottleneck with running clippy.py is the duplicate removal stage.

  • Use previous cached parse results (collection.json), to only consider new clippings since last parse for duplicate detection...
  • add a --no-cache flag to opt out of this behaviour (e.g. in case user didn't remove duplicates previously cached run)

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.