highlights
Convert Kindle "My Clippings.txt" files into structured data.
Highlights for ebooks manually uploaded to a Kindle device are stored in the on-device "My Clippings.txt" rather than the usual highlight notebook. This CLI converts "My Clippings.txt" into JSON so you can easily import it into other formats. Or, create a SQLite database that you can query directly.
Shoutout to Standard Ebooks for being the reason I have so many highlights stored as Kindle clippings.
Usage
cargo run -- --filename ~/Documents/My\ Clippings.txt --format jsonOptions
-
--filename: Path to Kindle clippings file (required) -
--format: Output format -json,summary, orsqlite(default: summary) -
--outfile: Write to file instead of stdout (optional, defaults tohighlights.dbfor sqlite format)
Outputs
JSON Format
[
{
"title": "Book Title",
"author": "Book Author",
"kind": "Highlight",
"page": "42",
"location": "1234-1235",
"location_start": 1234,
"location_end": 1235,
"date": "Monday, March 4, 2024 5:17:31 PM",
"content": "The highlighted text"
}
]SQLite Format
The sqlite format creates a SQLite db with two tables:
- highlights: Same as the JSON format, but only stores Highlights (no bookmarks or notes).
- notes - Notes that point to a highlight_id reference.
Example query:
select notes.content, highlights.title
from notes
join highlights on highlights.id=notes.highlight_id;Build
cargo build --release