Skills

Xberg Extracting Tables

Use when extracting tabular data from PDFs, spreadsheets, or images.

Install

npx skills add xberg-io/xberg --skill xberg-extracting-tables -g -a claude-code -y
Repository
xberg-io/xberg9.5k
Category
Engineering
Updated
3d ago
License
MIT
Context cost
Lightabout 1,400 tokens
Runs scripts
No, instructions only

What it does

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.

<!-- AI-RULEZ :: GENERATED FILE, DO NOT EDIT Content-Hash: blake3:80d26904ff70da39df4ee2b35bcfc06a186b30c0d2566cf4b60832cd42e475ef Source-Hash: blake3:4a90223a333b0f963ae8cdec4f38db88b769132c5dd1b7f39a7fe8e84f57f83e 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:

Read the whole SKILL.md on GitHub

More in Engineering