Convert technical books (native-text PDFs) into clean, chapter-split, LLM-ready Markdown using a dual-pass MinerU pipeline plus fidelity-preserving post-processing.
Project description
pdf2wiki
Convert heavily technical books (native-text PDFs) into clean, chapter-split, LLM-ready Markdown — code byte-perfect, tables intact, diagrams transcribed to Mermaid — suitable for an Obsidian vault or any Markdown-native knowledge base.
Built on MinerU with a dual-pass strategy: a pipeline pass
(-m txt) takes byte-perfect code and text from the PDF's embedded text layer, a hybrid/VLM pass
(--effort high) reconstructs table grids and transcribes diagrams to Mermaid, and a base-driven merge
grafts the good parts together — token-verifying code so a hallucinating VLM never corrupts a listing.
A six-step post-processing chain then cleans and splits the result into per-chapter files.
Why two backends instead of one: why a dual-backend pipeline.
Requirements
- Linux (native or WSL2) with an NVIDIA GPU, ≥ 8 GB VRAM, CUDA driver installed
- Python ≥ 3.11
- MinerU ≥ 3.4 on
PATH - A C compiler for vLLM's Triton JIT:
sudo apt install build-essential python3-dev
Only the conversion needs the GPU — phase5, qa, and scan run anywhere Python runs. No GPU at all?
offload the hybrid pass to a server (pipeline local on CPU,
VLM pass remote), use a remote GPU, or — with no local setup at all —
convert in the cloud via the managed mineru.net API.
Install
uv tool install pdf2wiki # or: pip install pdf2wiki
Full steps: install pdf2wiki. The install includes every converter, cloud included — no separate extra.
Quickstart
# 1. convert one book -> out/my-book/my-book.md + images/ + blocks.json
pdf2wiki convert book.pdf --name my-book
# 2. preview the cleanup + chapter split (dry-run)
pdf2wiki phase5 out/my-book/my-book.md --book my-book
# 3. apply it -> out/my-book/chapters/00-front-matter.md, 01-….md, …
pdf2wiki phase5 out/my-book/my-book.md --book my-book --source-name book.pdf --apply
New here? Follow the guided tutorial: convert your first book.
Query the vault: the llm-wiki plugin
pdf2wiki builds a knowledge vault; the bundled llm-wiki Claude Code plugin reads one — so
Claude can consult it while you plan, and review your code against it, always citing the exact
[[Page-Name]]. It's the "LLM Wiki" pattern (an alternative to RAG/embeddings): plain Markdown read
just-in-time, with coverage discovered from the vault itself. Standalone (works with any vault in the
shape pdf2wiki produces) and MIT-licensed.
claude plugin marketplace add https://github.com/Sevthered/pdf2wiki
claude plugin install llm-wiki@pdf2wiki
Query-side (consult + review) ships now; ingest-side is a later release. Details:
plugin/ · llm-wiki documentation.
Documentation
Full docs live in docs/, organized by intent (Diátaxis):
- Tutorials — convert your first book
- How-to — convert · post-process & split · batch · QA · remote GPU · offload hybrid to a server · convert in the cloud · troubleshoot
- Reference — CLI · configuration · pipeline stages · phase 5 steps · output layout
- Explanation — why dual-backend · how the merge works · design principles
- Architecture — overview with C4 diagrams
- Plugin — llm-wiki (query/review a vault)
Status
Alpha. All stages are functional; the converter was ported from a production deployment validated on several full technical books, and the coverage gate hard-stops rather than silently dropping content. Remote mode is experimental — no full public end-to-end run yet; prefer local mode.
License
AGPL-3.0-or-later for the converter. This tool drives the MinerU CLI (AGPL-3.0) as an external process.
The bundled plugin/ (the llm-wiki Claude Code plugin) is MIT-licensed — see plugin/LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf2wiki-0.2.2.tar.gz.
File metadata
- Download URL: pdf2wiki-0.2.2.tar.gz
- Upload date:
- Size: 114.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
842a3ae109774fde29ff16f0390ba2566f676218b00b9d8bbf5cfd1c2fda83c1
|
|
| MD5 |
e6afc48785c90136dc30844c39bb5240
|
|
| BLAKE2b-256 |
08e7d9ee9dd429f2f6289d497513b458cda52c5eeae8e764a9207ce49f6a3675
|
File details
Details for the file pdf2wiki-0.2.2-py3-none-any.whl.
File metadata
- Download URL: pdf2wiki-0.2.2-py3-none-any.whl
- Upload date:
- Size: 64.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eae87230d1688d0845e39863b72e63cd95d5c774c320563a8e8f68df9b5bbe3c
|
|
| MD5 |
b2ee9d69495bbb48b3e72a79919c0316
|
|
| BLAKE2b-256 |
0efb280758c3eb0b83ccc273b160dd2210572f0848c11c4cb9dcc2fafdb4d508
|