Skip to content

/xberg-extracting-tables

Use when extracting tabular data from PDFs, spreadsheets, or images. Covers layout-aware table detection, table model selection, output formats (markdown / JSON cells), and known limits.

From plugin
xberg
9.6k7 skills2 commands1 MCP

Claude Code

$ npx -y skills add xberg-io/xberg --skill xberg-extracting-tables --agent claude-code

SKILL.md

xberg-extracting-tables.SKILL.md
description: Use when extracting tabular data from PDFs, spreadsheets, or images. Covers layout-aware table detection, table model selection, output formats (markdown / JSON cells), and known limits.
name: xberg-extracting-tables

<!-- AI-RULEZ :: GENERATED FILE — DO NOT EDIT Content-Hash: blake3:80d26904ff70da39df4ee2b35bcfc06a186b30c0d2566cf4b60832cd42e475ef Source-Hash: blake3:349da3cd7af45e537dbb8e8aa6b033a84afccc9dd0f9ad1552d37ae18780228d Schema-Version: v1 -->

Extracting tables

Use this when the user wants structured tabular data — financial statements, scientific tables, invoices, spreadsheet-style PDFs. Xberg detects tables via a layout model (RT-DETR v2) and reconstructs cell structure with a configurable table model.

Basic usage

# Markdown tables embedded in the content stream
xberg extract report.pdf --layout --content-format markdown

# Structured JSON output, tables appear under result.tables
xberg extract report.pdf --layout --format json

`--layout` turns on layout-aware extraction; without it, tables fall back to plain text reflow and you lose cell boundaries.

Output shapes

Two surfaces, picked via `--format` (CLI shape) and `--content-format` (content rendering):

  • **Markdown tables in `content`** — `--content-format markdown`. Tables

appear inline as `| col | col |` blocks. Good for LLM ingestion.

  • **Structured `tables` array** — `--format json`. Each entry has

`cells[][]` (rows × cols), `markdown` (pre-rendered), `page_number`, `bounding_box`. Use this when downstream code needs exact cell access. (`bounding_box` is omitted when no position data is available.)

Both are populated at once when `--layout` is on. The `tables` array is always structured; the `content` stream switches representation.

xberg extract financials.pdf --layout --format json \
  | jq '.result.tables[] | {page: .page_number, rows: (.cells | length)}'

Table models

`--layout-table-model` picks the reconstruction backend:

| Model | Best for | Notes | | ------------------ | ----------------------------------------------------- | ------------------------------------------- | | `tatr` | dense complex tables (academic, financial) | **Default.** Heaviest, highest accuracy. | | `slanet_auto` | dispatches per-table to wired/wireless | Good when table styles are mixed. | | `slanet_wired` | tables with visible borders | Faster than tatr. | | `slanet_wireless` | tables without borders (whitespace-separated) | For invoices, simple grids. | | `slanet_plus` | hybrid wired / wireless | Lighter than `slanet_auto`. | | `disabled` | layout detection only, no table structure | Use to skip table model cost. |

xberg extract bank-statement.pdf \
  --layout --layout-table-model tatr --content-format markdown

Drop `--layout-confidence` when the layout model misses tables (default threshold ~0.5):

xberg extract noisy-scan.pdf --layout --layout-confidence 0.3

Spreadsheets

`.xlsx`, `.ods`, `.csv`, `.tsv` are extracted by dedicated parsers — no layout model needed. Each sheet becomes a markdown table (or structured table) automatically:

xberg extract workbook.xlsx --content-format markdown
xberg extract data.csv --format json

Pass `--no-cache=true` only when iterating on the same file with different configs.

Config file alternative

# `output_format` in config files equals `--content-format` on the CLI.
output_format = "markdown"

[layout]
confidence_threshold = 0.5
table_model = "tatr"

Then:

xberg extract report.pdf --format json

Programmatic access

From Python, structured tables live on the document in the result envelope (`result.results[0].tables`):

from xberg import ExtractInput, extract, ExtractionConfig, LayoutDetectionConfig

config = ExtractionConfig(
    layout=LayoutDetectionConfig(table_model="tatr"),
    output_format="markdown",
)
result = await extract(ExtractInput(uri="report.pdf"), config)
for table in result.results[0].tables:
    print(table.markdown)        # rendered markdown
    print(table.cells[0][0])     # cell access

Node.js mirrors this (`extract`, `output.results[0].tables`, camelCase fields). See `references/python-api.md` and `references/nodejs-api.md` for full type signatures.

Known limitations

  • **Merged cells** — reconstructed as repeated values across the spanned

region; the merge is not preserved as metadata.

  • **Rotated tables** — enable `--ocr-auto-rotate true` for image-based

PDFs before extraction.

  • **Nested tables** — flattened. Detection succeeds; structural nesting is

lost.

  • **Multi-page tables** — each page yields a separate `tables[]` entry.

Stitch by matching column headers if needed.

  • **ONNX Runtime required** — layout and table models are unavailable in

WASM builds and on the Android x86_64 emulator; native targets ship full support.

Common failure modes

  • **Empty `tables` with `--layout` on** — confidence threshold too high or

table model mismatched. Drop `--layout-confidence` to 0.3, try `--layout-table-model tatr`.

  • **Markdown tables look ragged** — switch `--layout-table-model` to

`slanet_wired` for bordered grids or `slanet_wireless` for invoices.

  • **Slow extraction** — `tatr` is heavy. Use `slanet_auto` or

`slanet_plus` as a default; reach for `tatr` only when accuracy matters.

See `references/cli-reference.md` for the full layout flag set and `references/advanced-features.md` for the layout pipeline internals.

Read more
@xberg-io
Ships withxberg

The fast, precise document-intelligence engine — for every language. Point Xberg at anything — a PDF, a scanned image, a spreadsheet, an audio file, a URL, a whole archive, or a source tree — and get back clean text, tables, metadata, and structured data.

Stars on GitHub

Momentum

stars in total
9.6k
Star history of xberg-io/xberg on GitHub, a chart by star-history.com

Other skills on xberg.

xberg-batch-extraction
Auto-invoked

xberg-batch-extraction

Use when extracting from many files at once with shared config, bounded parallelism, per-file overrides, and error recovery.…

@xberg-io@xberg-ioInstall Skill
xberg-chunking
Auto-invoked

xberg-chunking

Use when splitting extracted text into chunks for LLM context windows or RAG ingestion. Covers chunk size, overlap,…

@xberg-io@xberg-ioInstall Skill
xberg-extracting-keywords
Auto-invoked

xberg-extracting-keywo…

Use when extracting keywords (YAKE/RAKE) from documents — and, secondarily, when detecting document language or generating…

@xberg-io@xberg-ioInstall Skill
xberg-extracting-with-ocr
Auto-invoked

xberg-extracting-with-…

Use when extracting text from scanned PDFs, photographed pages, or images that have no embedded text layer. Covers OCR backends,…

@xberg-io@xberg-ioInstall Skill
xberg-picking-a-format
Auto-invoked

xberg-picking-a-format

Use when choosing an output format for extracted documents — plain text, markdown, djot, HTML, JSON, or DocTags. Maps consumer…

@xberg-io@xberg-ioInstall Skill
xberg
Auto-invoked

xberg

Extract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using…

@xberg-io@xberg-ioInstall Skill

More skills from other plugins.

paddleocr-doc-parsing

paddleocr-doc-parsing

Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…

paddleocr2mo93k
@paddlepaddle@paddlepaddleInstall Skill
context-loader
Auto-invoked

context-loader

Search memories from earlier Pi sessions in this repository. Use it when earlier work may already explain the code, error,…

mem02w69k
@mem0ai@mem0aiInstall Skill
analyzing-ai-citations

analyzing-ai-citations

Answer AI citation and answer engine optimization (AEO) questions in PostHog: whether AI answer engines (ChatGPT, Claude, and an…

posthog3w41k
@posthog@posthogInstall Skill

Questions about xberg-extracting-tables.

Which coding agents can use xberg-extracting-tables?
xberg-extracting-tables installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.