bf438159bfd1e43b4bc0928bc6e1c61a3d662d16
Now the script, when invoked with --direct with a Kindle attached and mounted, will parse clippings automatically, without My Clippings.txt into program's folder
Kindle Clippings Parser
A Python tool to convert Kindle's "My Clippings.txt" file into organized Markdown files, creating separate documents for each book with optional WebDAV upload functionality.
Features
- Parse Kindle clippings: Extract highlights and notes from "My Clippings.txt"
- Organize by book: Create separate Markdown files for each book
- Page references: Include page numbers or positions with each citation
- Safe filenames: Automatically sanitize book titles for filesystem compatibility
- WebDAV upload: Optional upload to cloud storage via WebDAV
- Batch operations: Clear and update entire collections
Installation
-
Clone this repository:
git clone <repository-url> cd KindleClippingsParser
-
Install Python dependencies:
pip install requests
Usage
Basic Usage
Convert your Kindle clippings to Markdown files:
python main.py "My Clippings.txt"
Advanced Options
# Specify custom output directory
python main.py "My Clippings.txt" -d custom_output_folder
# Upload to WebDAV server
python main.py "My Clippings.txt" --upload
# Upload without clearing existing files
python main.py "My Clippings.txt" --upload --no-clear
WebDAV Configuration
For WebDAV uploads, create a config.json
file:
{
"webdav": {
"base_url": "https://your-webdav-server.com/path",
"username": "your-username",
"password": "your-password"
}
}
Alternatively, use environment variables:
export WEBDAV_BASE_URL="https://your-webdav-server.com/path"
export WEBDAV_USERNAME="your-username"
export WEBDAV_PASSWORD="your-password"
Output Format
Each book generates a Markdown file with citations formatted as blockquotes:
> "Your highlighted text here" (p. 42)
> "Another highlight from the same book" (pos. 1234)
Requirements
- Python 3.6+
requests
library for WebDAV functionality
To-Do
- Auto-parse Kindle clippings directly from Kindle device
- GUI interface
License
This project is licensed under the MIT License - see the LICENSE file for details.
Languages
Python
100%