/kobo-highlights

A tool to extract and export highlights from Kobo e-readers.

Primary LanguagePython

Kobo Highlights Extractor

A Python tool to extract and export highlights from Kobo e-readers.

Features

  • Extract highlights from Kobo devices
  • Export highlights to TXT, JSON, CSV, and SQLite formats
  • List books with highlights
  • Count total highlights and books with highlights
  • Backup Kobo database

Setup

  1. Clone this repository:
git clone https://github.com/fidacura/kobo-highlights.git
cd kobo-highlights
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

You can use the script directly from the command line:

  1. Backup the Kobo database:
python kobo_highlights.py --backup backup.sqlite
  1. List books with highlights:
python kobo_highlights.py --list-books
  1. Get highlight count:
python kobo_highlights.py --count
  1. Export highlights (use one or more of --txt, --json, --csv, --sqlite):
python kobo_highlights.py --txt highlights.txt --json highlights.json
  1. Export highlights for a specific book:
python kobo_highlights.py --book-id [book_id] --csv book_highlights.csv
  1. Export highlights within a date range:
python kobo_highlights.py --date-from YYYY-MM-DD --date-to YYYY-MM-DD --json date_range_highlights.json

For more options, run:

python kobo_highlights.py --help

Testing

To run the tests: python -m unittest discover tests

Contributing

Contributions are welcome! Feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.