8000 GitHub - TariqMK/Klippings: Extract Highlights from MyClippings.txt into files per book. Fast and clean. · GitHub
[go: up one dir, main page]

Skip to content
TariqMKPublic

About

Extract Highlights from MyClippings.txt into files per book. Fast and clean.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

57 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Klippings. Turn Kindle clippings into notes and quotes.

Disclaimer: Most if not all of the code here has been written in Python with the help of AI


What is Klippings?

Klippings is a Kindle Highlight Processor aimed for use with Kindle's My Clippings.txt file, where book highlights for (sideloaded) documents reside.

Klippings exists to aid anyone who wishes for more granular control over their highlights and to be able to export and store them in an organised, systematic manner.

Your original My Clippings.txt file is not amended in any way.

Works offline. Sends no data. It goes online only when you click Check for Updates.

Klippings with a clippings file open: the book list on the left, the highlights of Walden in the middle, and the export options on the right

How Does it Work?

The highlights contained within My Clippings.txt contain entries from all the sideloaded books one has read on the Kindle device. For long term flexibility this is both inefficient and prone to data corruption and loss, especially over time as the file size grows ever larger.

Klippings takes My Clippings.txt as the input, scans it for all highlights, recognises if there are multiple books and then outputs a text file per book containing all related highlights, a folder of quote images per book, or both.

image

The option to output highlights with or without metadata is available, as illustrated in the screenshots below.

Klippings also has the ability to turn your highlights into images ready to share anywhere you like.

Screenshots

Quote images on, page and location off. The preview hides page and location to match the export:

Klippings with Quote images selected and Include page & location cleared: the font menu shows Vollkorn and the preview shows the highlights without page and location

Quote Image (Sample):

A 1080 x 1350 quote image of a highlight from Walden, with the book and author line at the bottom

Standard Export (Sample):

image

Simplified Export (Sample):

image

Run Directly

Download the latest version for Windows, macOS (Apple Silicon) or Linux from the Releases Page and run it.

The macOS app is unsigned, so the first time you open it you will need to approve it under System Settings > Privacy & Security.

Enjoy!

To find out if a newer version is available, click Check for Updates next to the version number. If there is one, select Yes to open its download page in your browser.

Privacy

  • Klippings works offline. Everything it does with your clippings happens on your computer.
  • It has no telemetry, analytics, crash reports or tracking.
  • Your highlights, text files and quote images are saved only in the folder you choose.
  • Your settings (the last folder you used) are saved in .kindle_highlights_config.json in your home folder.
  • The app makes one network connection, and only when you click Check for Updates. It sends one request to api.github.com to read the latest release number. It sends no data about you or your files, and it keeps nothing. GitHub sees your IP address, as with any web request.

Run From Source

Install the project and its required libraries from the repository root:

pip install .

Then simply run the command below to bring up the GUI:

klippings

Enjoy!

When run from source, the application shows the development version, v0.0.0.dev0. Only release builds show a real version number. Check for Updates doesn't go online in a development build.

To run the tests:

pip install ".[dev]"
pytest

Update the Screenshots

The screenshots come from the real app with sample clippings from public-domain books. Retake them after a change to the interface.

Note: The script needs Windows and a screen of at least 2240 x 1380 px. Do not cover the Klippings window while it runs.

  1. Set VERSION at the top of assets/make_screenshots.py to the newest release tag.
  2. From the repository root, run:
python assets/make_screenshots.py

The script writes the images to assets/screenshots.


Creating a Release

Run the Release workflow from the repository's Actions tab, on main, and choose:

  • Release type: draft or public
  • Version increment: patch, minor or major

The new version is worked out from the highest existing tag or release, including drafts. It is then shown in the application and used to tag the release. The workflow doesn't commit anything to main, so your local copy stays level with GitHub after a release.

To add release notes, edit the release on GitHub. The workflow only adds a link to the full list of changes.


Notes

  • Once you open a clippings file, the export options, save folder and Export button appear in a panel to the right of your highlights
  • The new text files are saved directly in the folder you choose, with no subfolder added
  • You can choose or drop several clippings files at once, such as those from different Kindles or dated backups. Their books are combined, and a highlight found in more than one file is kept once if its text, book, author, page, location and date are all exactly the same. Highlights are put in the order they were taken, by date and then location, or by location alone if a book has a date that can't be read
  • By default, each highlight keeps its page and location, saved as Book Title.txt. Turn off Include page & location to save your highlights cleanly for PKMS systems like Obsidian, as Book Title (simple).txt. The preview shows which version you'll get
  • When the application is run and the highlights have been extracted, a summary of books and highlights processed will be displayed in the application itself
  • Bookmarks, notes, article clips, empty highlights, clipping limit messages and copies from other files are left out of the export, and the application shows how many of each were skipped
  • Turn on Quote images to save each selected book's highlights as images, in a folder named after the book. Turn off Text files if you only want the images. Every image is 1080x1350, with the text at size 40 and line spacing of 15, wrapped at 43 characters, and the book and author line at size 27. A highlight too long for one image is shared evenly across several, like Highlight_0004_01.webp and Highlight_0004_02.webp, breaking at the end of a sentence where one is close. Fine ticks at the top centre of these images show how many there are and which one you're on
  • Vollkorn and Platypi are included for quote images, with their licences in klippings/fonts. To add a font, put a .ttf or .otf file in that folder. It's built into the app, so check its licence allows that and keep any licence file it requires alongside it
  • If a file with the same name is already in the folder, the application asks before replacing it
  • Keyboard shortcuts: Ctrl/Cmd+O chooses files, Ctrl/Cmd+Return exports, the arrow keys move through books, Space includes or leaves out the current book, and Esc cancels an export

Known Issues:

  • Over the years, Amazon has slightly changed the syntax of highlight metadata within My Clippings.txt. The common English formats are supported, but My Clippings.txt files from Kindles set to other languages are not yet, and their entries are counted as unrecognised. If you experience any problems, please raise an issue and I will look into it
  • A book with no author whose title ends in brackets, such as Book (Vol 1), will show Vol 1 as its author, as the file format doesn't distinguish the two
  • If you extend an existing highlight on your Kindle, both the old and new versions are kept, as Kindle records them as separate highlights
  • Quote images use a fixed text size and line length, so an unusually wide line, or a wider font, can come close to the image's edges

About

Extract Highlights from MyClippings.txt into files per book. Fast and clean.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

0