tabula-py
Extract tables from PDF files directly into pandas DataFrames.
Repository Health
Technical Analysis
tabula-py is a simple Python wrapper around tabula-java that reads tables embedded in PDF documents and turns them into pandas DataFrames. It bridges the Java-based Tabula extraction engine and the Python data-science ecosystem, so you can pull tabular data out of reports, invoices, statements, and scientific papers without manual copy-paste.
Beyond DataFrame conversion, tabula-py can write extracted tables straight to CSV, TSV, or JSON files, handle multi-page and remote PDFs, and apply lattice or stream extraction modes for different table layouts. It requires a Java 8+ runtime and integrates cleanly into notebooks and data pipelines.
What You Get
read_pdf()to extract one or many tables from a PDF into pandas DataFrames- Export helpers that convert PDF tables directly to CSV, TSV, or JSON files
- Support for multi-page documents, page ranges, and remote PDF URLs
- Lattice and stream extraction modes plus area/column tuning for tricky layouts
- Optional jpype-backed execution for faster repeated extraction
Common Use Cases
- Turning tabular data locked inside PDF reports into analysis-ready DataFrames
- Batch-converting collections of PDFs into CSV or JSON datasets
- Extracting financial, scientific, or government-report tables in notebooks
- Feeding PDF-sourced tables into ETL and data-cleaning pipelines
Under The Hood
Architecture — tabula-py is a thin, well-typed Python layer over the tabula-java JAR. The core read_pdf function builds a command invocation (or, with the jpype extra, an in-process JVM call) against tabula-java, passing options such as pages, area, columns, and lattice/stream mode, then parses the returned JSON/CSV output into pandas DataFrames. Conversion helpers reuse the same bridge to write CSV/TSV/JSON directly.
Tech Stack — Pure Python (3.9+) depending on pandas and numpy, bridging to tabula-java which requires a Java 8+ runtime. An optional jpype extra enables faster in-process JVM calls instead of subprocess invocation. Packaging and docs are handled via standard Python tooling and Read the Docs.
Code Quality — The project is mature (2,300+ stars, 450+ commits, 37 releases) with continuous-integration tests via GitHub Actions, hosted documentation with an extensive FAQ, and example notebooks runnable on Google Colab. The API surface is deliberately small and stable.
API Design — The developer experience centers on one obvious entrypoint, tabula.read_pdf(...), whose keyword arguments map onto tabula-java’s options. Returning standard pandas DataFrames means the output drops immediately into existing data workflows, and the documented FAQ covers the common Java/runtime pitfalls.