Skip to content

About

Extract Kindle clippings to json, search, show quote of the day.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Kindle Quotes

This is a simple Python script that extracts your Kindle highlights from the My Clippings.txt file and saves them in a json file. Then you can search in the json file for a specific book or author, or generate quote of the day.

Installation

  1. Clone the repository
  2. Install the requirements
uv sync

Usage

To extract the quotes from the My Clippings.txt file if Kindle is connected on Mac and Linux the file is autodetected. Or specify the path to file. The quotes are written to data/quotes.json unless --export-file says otherwise. Run the following command:

uv run python3 kindle_quotes export-kindle-quotes --my-clippings <path-to-my-clippings-file>
uv run python3 kindle_quotes export-kindle-quotes --export-file <path-to-json-file>

Quote of the day, shows a random quote from the json file and tracks the quotes that have been shown.

uv run python3 kindle_quotes show-quote

To search for a specific book, author or quote run the command below. The search is case insensitive. Multiple search terms can be used. The format of the output can be raw or simple (default).

uv run python3 kindle_quotes find-quote --book <book-name-part>
uv run python3 kindle_quotes find-quote --author <author-name> --format raw
uv run python3 kindle_quotes find-quote --author <author-name> --qoute <quote-part>
uv run python3 kindle_quotes find-quote --help

To list the books or the authors you have highlights from, together with the number of quotes for each. Both commands share the same options: --sort (count, the default, or name), --reverse to flip the order, --limit N to show only the top N entries (0, the default, shows all) and --format (simple or raw).

uv run python3 kindle_quotes show-books
uv run python3 kindle_quotes show-books --limit 10
uv run python3 kindle_quotes show-authors --sort name
uv run python3 kindle_quotes show-authors --reverse --format raw

Both also take an optional search argument that filters the listed names by a case insensitive substring, the same way find-quote matches. The counts are the full counts for the matched book or author, not a count of the matches.

uv run python3 kindle_quotes show-authors Taleb
uv run python3 kindle_quotes show-books sapiens --format raw

Output of show-books:

Homo deus (99)
Sapiens (59)

Output of show-authors Taleb. An author spelled several ways in your clippings stays several entries, each under its own spelling:

Nassim Nicholas Taleb (131)
Taleb, Nassim Nicholas (73)

About

Extract Kindle clippings to json, search, show quote of the day.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages