https://github.com/alex-schaaf/klip
Extract kindle clippings and sort them by author and book title into folders and markdown files.
https://github.com/alex-schaaf/klip
cli ebook kindle python3 script typer
Last synced: 8 days ago
JSON representation
Extract kindle clippings and sort them by author and book title into folders and markdown files.
- Host: GitHub
- URL: https://github.com/alex-schaaf/klip
- Owner: alex-schaaf
- Created: 2019-08-13T09:43:42.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-13T15:15:16.000Z (almost 4 years ago)
- Last Synced: 2024-11-16T05:31:56.397Z (6 months ago)
- Topics: cli, ebook, kindle, python3, script, typer
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# klip

A tiny Python CLI program that reads your book highlights from a connected Kindle device, sorts through the mess and organizes all clippings into per-book markdown files and saves them into author folders at a given destination folder.
## Usage
The script just needs the input file and an output folder:
```
$ python klip.py "~/Documents/kindle_highlights"Sync complete.
Successfuly synced 22 new highlights to ~/Documents/kindle_highlights
Skipped 901 highlights already existing at ~/Documents/kindle_highlights
```This will sort everything into this folder structure:
```
Clippings
└─── Author A
| | Book A1.md
| | Book A2.md
...
└─── Author Z
| Book Z1.md
```With the markdown files being formatted as follows:
```
# What I Talk About When I Talk About Running (Haruki Murakami)## Page 2 | Location 26-27 | 28 January 2018 22:26:17
No matter how mundane some action might appear, keep at it long enough and it becomes a contemplative, even meditative act....
```The program automatically checks if highlights already exist at the destination and only appends new ones to their respective files.
## Installation
First clone this repository using git:
```
$ git clone https://github.com/alex-schaaf/klip.git
```Then install the dependencies using either the provided `Pipfile` or manually.
### Pipenv
```
$ pip install pipenv
$ pipenv install
```### Manual
```
$ pip install typer
```### Using the CLI
Run the program to export the highlights as sorted markdown files:
```
$ python klip.py
```To export the Kindle highlights as JSON run with flag `--json`:
```
$ python klip.py --json
```