Skip to content

Repository files navigation

clone-ebook

Changelog License

This application uses OCR to create a backup of an ebook that you own from the screen on your PC.

Currently a work in progress!

Prerequisites

Pandoc

You will need to install Pandoc. It must be on your system PATH — the pypandoc Python package is only a wrapper and does not bundle pandoc itself.

Windows:

winget install JohnMacFarlane.Pandoc

Restart your terminal after installing so the PATH update takes effect.

macOS:

brew install pandoc

Linux:

sudo apt install pandoc   # Debian/Ubuntu
sudo dnf install pandoc   # Fedora

For other platforms see: https://pandoc.org/installing.html

Installation

Using uv (recommended)

First, install uv if you haven't already:

# On Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# On macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

Then clone and set up the project:

git clone https://github.com/chiplukes/clone-ebook
cd clone-ebook
uv sync

Using pip (alternative)

git clone https://github.com/chiplukes/clone-ebook
cd clone-ebook
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
pip install -e .

Usage

Running main application:

# With uv
uv run python main.py

# Or if venv is activated
python main.py

Convert existing PDF to markdown

To convert an existing PDF file directly to markdown (skips screen capture):

uv run python main.py --input_pdf "path/to/your/book.pdf"

TODO

  • Evaluate replacing pypandoc/pandoc with ebooklib for EPUB generation. ebooklib is pure Python and would remove the pandoc system binary requirement. Tradeoff: pandoc currently produces better-structured EPUB output.

Development

Install development dependencies:

uv sync --extra dev

For using pre-commit hooks:

uv run pre-commit install

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages