Skip to main content
The TableChef is a versatile chef that extracts and processes tables from multiple sources. It can read CSV and Excel files, convert them to markdown format, or extract tables from markdown text. The parsed tables are returned in a structured format ready for downstream processing.

Installation

TableChef requires the pandas library for processing CSV and Excel files.
pip install "chonkie[table]"
For more installation options, see the Installation Guide.

Initialization

from chonkie import TableChef

chef = TableChef()

Methods

process()

Process a file or markdown string to extract tables.

Parameters

path
Union[str, Path]
required
Can be a file path (CSV/Excel) or a markdown string containing tables

Returns

List[MarkdownTable] | None
A list of MarkdownTable objects. None if no tables are found

process_batch()

Process multiple files or markdown strings at once.

Parameters

paths
Union[List[str], List[Path]]
required
List of file paths or markdown strings to process

Returns

List[MarkdownTable] | None
A list of MarkdownTable objects. None if no tables are found

Usage

from chonkie import TableChef

# Initialize the chef
chef = TableChef()

# Process a CSV file
markdown_table = chef.process("data.csv")
print(markdown_table)

Supported File Formats

  • CSV files (.csv) - Comma-separated values
  • Excel files (.xls, .xlsx) - Microsoft Excel spreadsheets
  • Markdown strings - Text containing pipe-separated tables
I