# Pdf Table To Excel

> >

- **Type:** Skill
- **Install:** `agentstack add skill-kujiangmudao-tablepack-pdf-table-to-excel`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [kujiangmudao](https://agentstack.voostack.com/s/kujiangmudao)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [kujiangmudao](https://github.com/kujiangmudao)
- **Source:** https://github.com/kujiangmudao/tablepack/tree/main/skills/pdf-table-to-excel
- **Website:** https://github.com/kujiangmudao/pdf-excel

## Install

```sh
agentstack add skill-kujiangmudao-tablepack-pdf-table-to-excel
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# TablePack — PDF tables → Excel packages

**Read root `AGENTS.md` first.** This skill is the executable checklist.  
Product name **TablePack**; CLI module remains `python -m pdf_excel`.

## Who is the user?

| Path | Action before convert |
|------|------------------------|
| **A — already has MinerU** | Confirm `mineru` on PATH or `config.yaml` → `mineru_bin`. **Do not require the user to learn MinerU CLI** — only run TablePack. |
| **B — no MinerU** | Windows: `scripts/install_mineru.ps1` · Unix: `scripts/install_mineru.sh`. Activate `.venv-mineru`. See `docs/INSTALL.md`. Still **no MinerU tutorial** — only `python -m pdf_excel`. |

**Product promise:** install MinerU (or Path B), put PDFs in `pdf/`, one command packages Excel + `原始表格/` + notes.

## Model requirement (critical)

| Stage | Needs vision? | Why |
|-------|---------------|-----|
| Run `python -m pdf_excel` | No | CLI + MinerU HTML path |
| **QC / fix sheets** | **Yes — multimodal** | Open `原始表格/*.jpg` and compare to Excel |

If the model **cannot see images**:

1. Still run packaging.
2. **Do not claim** “已严格质检”.
3. Ask for a vision-capable model or human review for QC.

## Environment (portable)

Prefer `config.yaml` / env / CLI — do **not** hardcode another machine’s paths.

| Item | Default |
|------|---------|
| Entry | `python -m pdf_excel` or `python convert_pipeline.py` |
| PDFs | `pdf/` |
| Output | `output/` |
| MinerU cache | `work/mineru_raw/` |
| MinerU | `config.yaml` / `MINERU_BIN` / PATH / `.venv-mineru` |

Recommended MinerU flags (also set in config):

```text
mineru -p  -o work/mineru_raw -b pipeline -m auto -l ch -t true -f false
```

CPU-only → `pipeline`. Higher-accuracy VLM/hybrid only if installed and requested; **QC still mandatory**.

## Required package layout

```text
output//
  ├── .xlsx
  ├── 原始表格/          # required screenshots
  ├── 图片/
  └── 转换说明.md | 问题说明.md
```

## Business rules

1. MinerU is primary parser; OCR/pdfplumber only for repair.
2. One PDF → one Excel (same stem).
3. All tables → sheets in that one workbook.
4. Always include `原始表格/` images for human comparison.
5. After auto convert: **visual QC vs screenshots**; rewrite bad sheets.
6. Unrecoverable → markdown explanation; **never invent cells**.

## Workflow

### 1. Prepare

- PDFs in `pdf/` (or user path)
- List work items; respect skip-existing only if user asks

### 2. Parse

```bash
python -m pdf_excel --force   # or without --force to reuse cache
# filters:
python -m pdf_excel 关键词
```

- Read `*_content_list.json` (prefer non-v2 with `table_body` HTML)
- Collect `type==table` and `image`/`chart`

### 3. Excel

- HTML (+ rowspan/colspan) → grid → openpyxl multi-sheet
- Sheet names: `表N_中文标题` (≤31 chars)
- Empty `table_body` → drop by default (`drop_empty_tables`)

### 4. Package

- xlsx + `原始表格/` + `图片/` + notes
- Rotate unreadable table crops before QC when needed

### 5. Forced QC (never skip) — vision step

For each sheet (**multimodal**):

1. **Open image**: matching `原始表格/表N_*.jpg` via vision / image read — not HTML alone
2. Check headers, dims, IDs, numbers against the screenshot
3. Fix xlsx immediately when wrong (openpyxl or rewrite sheet)
4. Print conflicts → keep print + note
5. Landscape disasters → rotate crop + OCR + manual rebuild

Checklist:

- [ ] Sheet count / titles
- [ ] Headers & dimensions
- [ ] Symbols / subscripts
- [ ] Values (spot-check full rows on the **image**)
- [ ] Assets complete
- [ ] Notes file present

### 6. Failures

| Case | Action |
|------|--------|
| No table objects | Placeholder xlsx + `问题说明.md` |
| Empty/broken HTML | Repair from image if possible; else document |
| Full fail | Keep folder + notes + partial assets |

### 7. Close-out

- Update `output/_summary.json` (pipeline writes it)
- Report per-PDF table counts, fixes, known gaps

## Forbidden

- Deliver auto-only without QC
- Mix multiple PDFs into one xlsx (unless user asks)
- Omit `原始表格/`
- Fabricate data
- Claim “strictly checked” without reading table images/values

## Code map

| Module | Role |
|--------|------|
| `pdf_excel/pipeline.py` | End-to-end packaging |
| `pdf_excel/html_table.py` | HTML → grid |
| `pdf_excel/excel_writer.py` | Multi-sheet xlsx |
| `pdf_excel/clean.py` | OCR normalizations |
| `pdf_excel/cli.py` | CLI |
| `convert_pipeline.py` | Thin entry wrapper |

New batches: **pipeline → visual fix → notes**. Optional local fix scripts stay out of git if they contain private data.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [kujiangmudao](https://github.com/kujiangmudao)
- **Source:** [kujiangmudao/tablepack](https://github.com/kujiangmudao/tablepack)
- **License:** MIT
- **Homepage:** https://github.com/kujiangmudao/pdf-excel

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-kujiangmudao-tablepack-pdf-table-to-excel
- Seller: https://agentstack.voostack.com/s/kujiangmudao
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
