Skip to main content

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

CI PyPI Python License: AGPL-3.0 codecov OpenSSF Scorecard OpenSSF Best Practices OpenSSF Baseline

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):

Contributing

Contributions are welcome — see CONTRIBUTING.md for setup and conventions, GOVERNANCE.md for how the project is run and who maintains it, and the Code of Conduct. Where the project is headed: the roadmap.

Reporting bugs. Found a defect or have a feature request? Open a GitHub issue — the bug-report template prompts for the version, environment, steps to reproduce, and expected vs actual behavior. Security issues must be reported privately per SECURITY.md, never as a public issue.

Repository scope. pdf2wiki is a single repository with no separate subprojects or additional repositories; the bundled llm-wiki Claude Code plugin ships in-repo under plugin/.

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 (SSH) and cloud (--mineru-cloud) modes now have a verified end-to-end run on a real GPU box — a single-book conversion over SSH and a cloud dual-pass merge — but have not yet been exercised at full-book batch scale, so prefer local mode for large runs.

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


Download files

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

Source Distribution

pdf2wiki-0.2.8.tar.gz (210.4 kB view details)

Uploaded Source

Built Distribution

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

pdf2wiki-0.2.8-py3-none-any.whl (91.6 kB view details)

Uploaded Python 3

File details

Details for the file pdf2wiki-0.2.8.tar.gz.

File metadata

  • Download URL: pdf2wiki-0.2.8.tar.gz
  • Upload date:
  • Size: 210.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pdf2wiki-0.2.8.tar.gz
Algorithm Hash digest
SHA256 a3e82c71c834b5437559e7664470b83e2115afe088b435158ceeeabada16120d
MD5 451296d8bd9a0ef626fc1577d357e707
BLAKE2b-256 952bf19c3db920cacb6bc4117f300d5ee8ecd8b09f7bb8512ba437ebd4113e17

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf2wiki-0.2.8.tar.gz:

Publisher: publish.yml on Sevthered/pdf2wiki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdf2wiki-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: pdf2wiki-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 91.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pdf2wiki-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 711bf49b4510ebc8cfd76c6ad897d3e3ad4ea1f0ff853f37f0cdc36a0e88dfc6
MD5 ad2e1d1be3169eb83db36e07944aa736
BLAKE2b-256 cbbd87929c48cb6afa27d15e863cb4365370cde676afee4d7b51da337ca7f560

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf2wiki-0.2.8-py3-none-any.whl:

Publisher: publish.yml on Sevthered/pdf2wiki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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