mcpField
E
ebook-extractor

ebook-extractor

github.com/ratacatDocuments58107 installsUpdated 37w ago
Repository

About ebook-extractor

ebook-extractor is a Python-based skill for extracting plain text from EPUB, MOBI, and PDF books. It suits workflows that need text without LLM processing, with format-specific scripts and a unified auto-detecting command.

Key features

  1. 01Extracts text from EPUB, MOBI, and PDF
  2. 02Detects file format automatically
  3. 03Writes output to stdout or a file
  4. 04Provides separate scripts by format

Use cases

  1. 01Extracting book text for downstream processing
  2. 02Saving extracted text to a plain-text file

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ratacat/claude-skills --skill ebook-extractor

After installing, type/ebook-extractorin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

requirements.txt
setup.sh
scripts/
extract_epub.py
extract_mobi.py
extract_pdf.py
extract.py

Details

From the project README

Ebook Text Extractor

Overview

Extract plain text from EPUB, MOBI, and PDF files using Python scripts. No LLM calls - pure text extraction.

Supported Formats

FormatTool UsedNotes
EPUBebooklib + BeautifulSoupDirect parsing, preserves structure
MOBICalibre ebook-convertConverts to EPUB first, then extracts
PDFPyMuPDF (fitz)Fast, handles most PDFs well

Usage

Unified extractor (auto-detects format):

python3 ~/.claude/skills/ebook-extractor/scripts/extract.py /path/to/book.epub
python3 ~/.claude/skills/ebook-extractor/scripts/extract.py /path/to/book.mobi
python3 ~/.claude/skills/ebook-extractor/scripts/extract.py /path/to/book.pdf

Output options:

# To stdout (default)
python3 scripts/extract.py book.epub

# To file
python3 scripts/extract.py book.epub -o output.txt
python3 scripts/extract.py book.epub > output.txt

Format-specific scripts:

python3 scripts/extract_epub.py book.epub
python3 scripts/extract_mobi.py book.mobi
python3 scripts/extract_pdf.py book.pdf

Setup

# One-command setup (installs all dependencies)
~/.claude/skills/ebook-extractor/setup.sh

# Or manually:
pip install -r ~/.claude/skills/ebook-extractor/requirements.txt
brew install calibre  # macOS, for MOBI support

Script Location

~/.claude/skills/ebook-extractor/scripts/

Common Issues

ProblemSolution
Missing packageRun setup.sh or pip install -r requirements.txt
MOBI failsEnsure Calibre is installed: brew install calibre
PDF garbledSome PDFs are image-based; OCR needed (not supported)

Comments

Markdown supported