Skip to main content

Universal document unbinder — any format → Markdown (for AI) or EPUB (for humans)

Project description

unbind

把任何文档变成自由的知识。 一份文件进来,两条路出去:Markdown(喂给 AI 分析)或 EPUB(自己深读细品)。

PDF、Word、PPT、网页、CSV…扔进去,自动识别格式,高质量输出。


它能做什么

场景 命令
把 PDF 论文转成 EPUB,在电纸书上读 unbind bind paper.pdf
把 Word 合同转 EPUB,手机随时翻 unbind bind contract.docx
把 PPT 演讲稿转 Markdown,发给 AI 润色 unbind extract slides.pptx
把网页文章存成 EPUB 离线读 unbind bind https://example.com/essay
把 CSV 数据转 Markdown,粘贴给 AI 分析 unbind extract data.csv
从终端直接写内容,生成 EPUB echo "# 笔记" | unbind bind -

安装指南

第一步:确认你有 Python

打开终端(Terminal),输入:

python3 --version

如果显示 Python 3.10 或更高版本,继续下一步。如果低于 3.10,先从 python.org 安装最新版。

macOS 用户:系统自带的 Python 版本较老,建议用 Homebrew 安装:

brew install python@3.12

第二步:安装 unbind

pip install unbind

如果你没有 pip,试试:

pip3 install unbind

如果还不行(macOS 常见),用:

pip3 install --user unbind

安装完成后验证:

unbind --help

看到命令帮助就说明安装成功了。

第三步(可选):安装 PDF 支持

要把 PDF 转成高质量 EPUB,需要额外安装 AI 引擎:

pip install unbind[pdf]

装完会自动下载 AI 模型(约 1.5GB),只下载一次。如果网速较慢,耐心等几分钟。

不装 [pdf] 的话,Word、PPT、网页、CSV 等其他格式都能正常用,只有 PDF 不支持。


使用指南

unbind 就两个命令:

  • unbind extract — 提取内容,输出 Markdown(喂 AI)
  • unbind bind — 打包成 EPUB(人读)

例子一:把 PDF 转成 EPUB

unbind bind 我的论文.pdf

运行完会生成 我的论文.epub,双击用 Apple Books 打开就能读。

指定书名和作者:

unbind bind 我的论文.pdf -o 论文.epub --title "我的博士论文" --author "张三"

例子二:把 Word 文档转成 Markdown

unbind extract 合同.docx -o ./output

会在 ./output/ 目录下生成 合同.md,可以直接复制粘贴给 ChatGPT 或 Claude。

例子三:把网页文章存成电子书

unbind bind https://zh.wikipedia.org/wiki/EPUB -o epub介绍.epub

例子四:管道输入

cat 笔记.txt | unbind bind - --title "我的读书笔记"

支持格式

格式 输入 → Markdown 输入 → EPUB 使用的引擎
PDF marker-pdf(AI 识别版面)
DOCX / DOC markitdown
PPTX / PPT markitdown
XLSX / XLS markitdown
HTML markitdown
EPUB markitdown
CSV markitdown
Markdown / TXT 内置
JSON markitdown
RSS markitdown
图片(OCR 描述) markitdown + LLM
音频(转文字) markitdown
ZIP(递归解压) markitdown
Wikipedia URL markitdown
YouTube URL markitdown

常见问题

Q: 转换 PDF 时报错 "No module named marker"

没装 PDF 支持。运行:

pip install unbind[pdf]

Q: 第一次转 PDF 等了很久

正常。首次运行要下载 AI 模型(1.5GB),之后就是秒级处理。

Q: EPUB 在 Apple Books 里显示乱码

试试用 --language 指定语言:

unbind bind book.pdf --language zh

Q: 报错 "unbind: command not found"

Python 的 bin 目录不在 PATH 里。试试:

python3 -m unbind bind book.pdf

或者重新安装,安装完成后看终端输出的提示,把提示的路径加到 ~/.zshrc 里。

Q: 能把 EPUB 转回 PDF 吗?

不能。unbind 的方向是「任何格式 → EPUB/Markdown」,反方向暂时不支持。


开发

git clone https://github.com/zhouxia/unbind.git
cd unbind
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,pdf]"

运行测试:

python3 -m pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unbind-0.1.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unbind-0.1.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file unbind-0.1.0.tar.gz.

File metadata

  • Download URL: unbind-0.1.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for unbind-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec20f1a137388356e5a4e6941dba9d1e72a8d245b8fe19cd5205b0d01bfd8c36
MD5 dd5a6c5af8167e5456dd7c1e53466df1
BLAKE2b-256 9b00cebcaef688d5fe1c6935cbfbc545cdff4331378b5dcf830321c04b5dd9dd

See more details on using hashes here.

File details

Details for the file unbind-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: unbind-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for unbind-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1260585a9cd74e7fcd92f9dc977a75bca7afdf49853addf0a5ac38393ba0e13
MD5 e4352d54d6750350a3a6d2921e7bc56b
BLAKE2b-256 27d401771bd9dc0c50b4830112a2138d46161a6182c174e1ca97bab184555537

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page