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

PyPI Python License: AGPL-3.0

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.

Install

uv tool install pdf2wiki        # or: pip install pdf2wiki

Full steps: install pdf2wiki.

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.

Documentation

Full docs live in docs/, organized by intent (Diátaxis):

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. This tool drives the MinerU CLI (AGPL-3.0) as an external process.

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.1.2.tar.gz (74.2 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.1.2-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdf2wiki-0.1.2.tar.gz
  • Upload date:
  • Size: 74.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for pdf2wiki-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1bc23b8404ce7f96be6e6024a018f9804255533cd02535b8bd2bdd2474aba145
MD5 6ef9397991bbcd96de16cfb36d3e9b72
BLAKE2b-256 06cff95560e3b50e7dff9509c7bc551681142427c57ab84aae1004d963176940

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf2wiki-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for pdf2wiki-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 caba183f62e13c4915fa15200b0e5f190f2d318837e04bc187ecf308c720ef64
MD5 f68418bf04e2c34228b9758842b8a5b4
BLAKE2b-256 1b93ee7eef836b37c974c84fa70fa7a9638ae4830da6fdab748e79cd1540a61e

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