ebook-to-md

v1.0.0

Convert PDF/PNG/JPEG/MOBI/EPUB to Markdown. Uses Baidu OCR only. Use when 扫描PDF转Markdown、pdf ocr、图像识别、电子书转Markdown、ebook to markdown.

0· 583·2 current·2 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for whille/ebook-to-md.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "ebook-to-md" (whille/ebook-to-md) from ClawHub.
Skill page: https://clawhub.ai/whille/ebook-to-md
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install whille/ebook-to-md

ClawHub CLI

Package manager switcher

npx clawhub@latest install ebook-to-md
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
medium confidence
!
Purpose & Capability
The skill's stated purpose (convert scanned PDFs/images/epub/mobi to Markdown using Baidu OCR) matches the implementation: the code calls Baidu OCR and a Baidu document parser and can convert MOBI/EPUB via Calibre. However the registry metadata declares no required environment variables or primary credential while SKILL.md and the code clearly require BAIDU_OCR_API_KEY and BAIDU_OCR_SECRET_KEY. This metadata omission is an incoherence worth noting.
!
Instruction Scope
SKILL.md instructs the agent to run the included script and to set Baidu OCR credentials. The implementation uploads user files (PDFs/images/ebooks converted to PDF) to Baidu endpoints (OAuth token, OCR endpoint, paddle-vl parser) and downloads parser results and images. That means user documents are transmitted to an external service (Baidu). The instructions and code do not provide strong warnings about this privacy/exfiltration risk. The code also fetches image URLs found in parser-generated HTML, which could trigger additional outbound network requests.
Install Mechanism
No install spec is provided (instruction-only plus shipped Python scripts). No arbitrary remote downloads or package installs beyond normal Python deps (requests) and optional Calibre. This is lower risk from an installation/execution provenance perspective.
!
Credentials
Functionally the skill needs Baidu API credentials (BAIDU_OCR_API_KEY, BAIDU_OCR_SECRET_KEY) to work; SKILL.md documents this and the tests skip OCR cases if these are unset. The registry metadata, however, lists no required env vars and declares no primary credential — an inconsistency that could mislead users into installing without realizing a cloud credential is required. No other unrelated secrets are requested.
Persistence & Privilege
The skill does not request persistent/always-on inclusion and does not modify other skills or system-wide settings. It does optionally load a .env file via python-dotenv if present (standard behavior), but this is limited and expected for a script that needs API keys.
What to consider before installing
This skill will upload the documents you give it (PDFs, images, converted EPUB/MOBI) to Baidu OCR/document-parser services to produce Markdown. If those documents contain sensitive or private information, do not use this skill unless you are comfortable sending that data to Baidu. Also note a metadata mismatch: the registry lists no required environment variables, but the SKILL.md and code require BAIDU_OCR_API_KEY and BAIDU_OCR_SECRET_KEY — verify that you supply credentials knowingly. If you need offline processing or stronger privacy guarantees, prefer a tool that does OCR locally (e.g., Tesseract/PaddleOCR run locally) or review the code thoroughly before running. Finally, review any fixtures or tests if you plan to run them (they may try to access Calibre or skip tests if keys are absent).

Like a lobster shell, security has layers — review code before you run it.

latestvk974g7n784640ep2mc34h3h1fx81r2ce
583downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

ebook_to_md Skill

将 PDF、图片、MOBI、EPUB 转为 Markdown。仅使用百度 OCR。

输入格式

  • PDF:扫描版/图像型 PDF
  • PNG/JPEG:单张图片
  • MOBI/EPUB:需安装 Calibre,先转 PDF 再处理

图片 OCR 输出会自动添加 Markdown 分段:首行若为短标题则转为 ##,对话段落前插入空行。

输出格式

仅输出 Markdown(.md)。

参数

ParameterTypeRequiredDefaultDescription
input_pathstringyes-文档路径(pdf/png/jpeg/mobi/epub)或 base64 图片
output_pathstringno-输出文件路径
ocr_backendstringno"baidu"保留参数,仅支持百度
inline_imagesboolnotrue图片是否 base64 内联

快速开始

# PDF 转 Markdown(百度 OCR)
python scripts/ebook_to_md.py --input_path=./scanned.pdf
# 图片转 Markdown
python scripts/ebook_to_md.py --input_path=./screenshot.png
# 指定输出路径
python scripts/ebook_to_md.py --input_path=./report.pdf --output_path=./report.md

依赖

Python

pip install requests

系统

  • Calibre(mobi/epub):brew install calibre
  • 百度 OCR:设置 BAIDU_OCR_API_KEYBAIDU_OCR_SECRET_KEY

使用示例

百度 OCR(默认)

from skills.ebook_to_md import main
main(input_path='./report.pdf', output_path='./report.md')
main(input_path='./image.png')  # 图片识别

MOBI/EPUB(需 Calibre)

main(input_path='./book.epub', output_path='./book.md')
main(input_path='./book.mobi', output_path='./book.md')

返回格式

成功:返回字符串,含预览;若指定 output_path 则写入文件。 失败:返回 "错误: ..."

相关

  • pdf_to_markdown:原生文本 PDF 转换(docling)

Comments

Loading comments...