The Palos Publishing Company

Follow Us On The X Platform @PalosPublishing
Categories We Write About

Generate reading logs from Kindle exports

To generate reading logs from Kindle exports, you typically need to process the “My Clippings.txt” file or a CSV/JSON export from Kindle apps (like the iOS/Android Kindle app or Kindle e-reader). Here’s how you can do it depending on the format you have:


✅ If You Have the My Clippings.txt File

Each entry in this file follows this general structure:

pgsql
Book Title (Author) - Your Highlight on Location 123-125 | Added on Saturday, January 1, 2022 12:00:00 AM This is the highlighted text. ==========

Python Script to Generate a Reading Log

Here’s a Python script that reads My Clippings.txt and creates a structured reading log:

python
import re from collections import defaultdict from datetime import datetime def parse_clippings(file_path): with open(file_path, 'r', encoding='utf-8-sig') as file: content = file.read().split("==========") log = defaultdict(list) for clip in content: lines = clip.strip().split('n') if len(lines) < 3: continue title_author = lines[0].strip() meta_line = lines[1].strip() quote = "n".join(lines[2:]).strip() date_match = re.search(r'Added on (.+)', meta_line) added_date = None if date_match: try: added_date = datetime.strptime(date_match.group(1), '%A, %B %d, %Y %I:%M:%S %p') except ValueError: pass log[title_author].append({ "quote": quote, "meta": meta_line, "added_on": added_date.strftime('%Y-%m-%d %H:%M:%S') if added_date else "Unknown" }) return log def print_reading_log(log): for book, entries in log.items(): print(f"n### {book}") for i, entry in enumerate(entries, 1): print(f"n{i}. {entry['quote']}") print(f" - Added on: {entry['added_on']}") print(f" - Meta: {entry['meta']}") # Example usage file_path = 'My Clippings.txt' log = parse_clippings(file_path) print_reading_log(log)

✅ If You Have a Kindle CSV Export (from Kindle App)

The CSV typically includes fields like:

  • Book Title

  • Author

  • Highlight

  • Page/Location

  • Date Added

You can use pandas to convert it into a log format:

python
import pandas as pd df = pd.read_csv("Kindle_Highlights.csv") for title in df['Book Title'].unique(): print(f"n### {title}") highlights = df[df['Book Title'] == title] for i, row in highlights.iterrows(): print(f"n{i+1}. {row['Highlight']}") print(f" - Location: {row['Location']}") print(f" - Date Added: {row['Date Added']}")

Output Format Example

pgsql
### Deep Work (Cal Newport) 1. "Clarity about what matters provides clarity about what does not." - Added on: 2022-06-15 14:30:22 - Meta: Your Highlight on Location 256-257 2. "If you don’t produce, you won’t thrive—no matter how skilled or talented you are." - Added on: 2022-06-15 15:04:03 - Meta: Your Highlight on Location 500-502

If you want, you can upload your My Clippings.txt or Kindle CSV export, and I’ll generate a formatted reading log for you directly.

Share this Page your favorite way: Click any app below to share.

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Categories We Write About