
Extracting Tables
FreeEffortlessly extract tabular data from various formats.
Free · Opens the source repo
What Extracting Tables does
Extracting Tables is a command-line tool designed to facilitate the extraction of structured tabular data from a variety of sources, including PDFs, spreadsheets, and images. Utilizing a layout-aware table detection model, this tool can accurately identify and reconstruct tables, making it ideal for users who need to work with financial statements, scientific data, or invoices. The tool supports multiple output formats, including Markdown and JSON, allowing for flexible integration into different workflows.
The extraction process is straightforward. Users can invoke the tool via command line, specifying the source file and the desired output format. By enabling layout-aware extraction with the --layout flag, users ensure that cell boundaries are preserved, which is crucial for maintaining the integrity of the data. The tool also allows for the selection of different table reconstruction models, enabling users to optimize for accuracy or speed based on their specific needs.
For those working with spreadsheets, Extracting Tables simplifies the process by automatically converting sheets from formats like .xlsx and .csv into structured tables without requiring layout detection. This feature makes it particularly useful for data analysts and developers who need quick access to tabular data without manual intervention. Additionally, the tool provides programmatic access via Python and Node.js, allowing developers to integrate table extraction capabilities into their applications seamlessly.
While Extracting Tables is powerful, users should be aware of its limitations. Merged cells are reconstructed as repeated values, and nested tables are flattened, which may not suit all use cases. However, the tool's capabilities in accurately detecting and reconstructing tables make it a valuable asset for anyone needing to extract structured data from unstructured formats.
When to use it
Use this tool when you need to extract tables from PDFs, images, or spreadsheets and require structured output for further processing.
When not to use it
Avoid using this skill for documents with heavily merged or nested tables, as these structures may not be preserved accurately.
What you can build with it
Extracting Financial Statements
Use this tool to extract structured financial data from PDF statements, making it easier to analyze and report.
Converting Spreadsheet Data
Quickly convert .xlsx or .csv files into structured Markdown or JSON tables for use in applications or reports.
Automating Data Ingestion
Integrate the tool into your data pipeline to automate the extraction of tabular data from various document formats.
How to install Extracting Tables
View source1. Install with the skills CLI
npx skills add xberg-io/xberg/extracting-tables --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by xberg-ioExtracting 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
tablesarray —--format json. Each entry hascells[][](rows × cols),markdown(pre-rendered),page_number,bounding_box. Use this when downstream code needs exact cell access. (bounding_boxis 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 in the
sibling xberg skill 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 truefor 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
tableswith--layouton — confidence threshold too high or table model mismatched. Drop--layout-confidenceto 0.3, try--layout-table-model tatr. - Markdown tables look ragged — switch
--layout-table-modeltoslanet_wiredfor bordered grids orslanet_wirelessfor invoices. - Slow extraction —
tatris heavy. Useslanet_autoorslanet_plusas a default; reach fortatronly when accuracy matters.
See references/cli-reference.md for the full layout flag set and
references/advanced-features.md for the layout pipeline internals.
Frequently asked questions about Extracting Tables
Similar skills
Single-Cell RNA-seq QC
Automate quality control for single-cell RNA-seq data.
Instrument Data to Allotrope Converter
Standardize lab data for seamless integration.
SQL Server Table Reconciliation
Efficiently compare SQL Server tables across instances.
Data Cleaning and Variable Screening
Streamline credit risk data preprocessing for modeling.
Arize Dataset
Manage and query Arize datasets efficiently.
Spreadsheet Management
Efficiently create, edit, and analyze spreadsheet files.
