Skip to content

Standalone Python tool to export highlights and notes from Moon+ Reader (Android) to your PC as clean, formatted HTML files.

Notifications You must be signed in to change notification settings

unalignedcoder/moonReader-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asset 3

Moon+ Reader Exporter

Standalone Python tool to export highlights and notes from Moon+ Reader (Android) to your PC as clean, formatted HTML files.

This script does not require Calibre and works with or without Root. It uses ADB (included).

Features

This script extracts notes and highlights from Moon+ Reader books, producing them in clean, well formatted html files.

It reads the e-book files from your device to extract the text surrounding your highlights, giving full context.

image
Highlights are much more useful if saved in context.

It respects the highlight colors selected in MoonReader.

imageimage
The original highlights in Moon+ Reader, and the exported HTML file.

Furthermore:

  • If a book was moved after import (e.g., from Downloads to Books), the script automatically searches the library to find it.
  • Tracks export history and only processes new highlights on subsequent runs, saving massive amounts of time.
  • Dual Mode:
    • Root Mode: Directly pulls the live database from /data/data/ on Android.
    • Non-Root Mode: Automatically finds and extracts Notes from Moon+ Reader backups.
  • Works on Windows, macOS, and Linux.

Prerequisites

  1. Python installed on your computer.
  2. USB Debugging enabled on your Android device.
  3. ADB: adb.exe (and its DLLs) can be found in the /adb folder next to the script. Otherwise, the script can use your system's ADB.

Installation

  1. Grab the zip file from the latest release. What you need are mre.py, mre.json and the adb folder as well, unless you already have adb in your PATH.
  2. Install the required Python library for HTML parsing:
    pip install beautifulsoup4

Usage

  1. If your phone is rooted, you can jump to step 3;

  2. Create a Backup from within Moon+ Reader (Settings > Backup.) Make sure it is saved somewhere within the Moon+ Reader /Books subfolders;

  3. If needed, edit options in the mre.json configuration file:

    image

    • Consider that paths can be relative (e.g. 'MoonReader_notes') or absolute (e.g. 'C:/Backups'). Under Windows, always use forward slashes /, or double back slashes \\;
    • Set context_chars to indicate the amount of characters preceding and following the highlighted quote, for context;
    • Set disable_context to true to skip book downloading/parsing entirely (significantly faster, but highlights and notes only);
    • Set enable_logging to true to save a detailed session log to the export folder;
    • Set use_root to false to force extraction from the Backup file. If true, on a rooted phone it reads the database directly from the /data/data Moonreader folder.
  4. Connect the phone to the PC, and make sure USB Debugging is enabled:

    image

  5. Launch the script from your pc: python mre.py

    image

  6. Enjoy fantastically well formatted Highlights and Notes saved for you in the context in which they were first taken, for research or memory.

Why, thank you for asking!
👉 You can donate to my projects here👈

About

Standalone Python tool to export highlights and notes from Moon+ Reader (Android) to your PC as clean, formatted HTML files.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages