skillfed

img2table

img2table is a table identification and extraction Python Library for PDF and images, based on OpenCV image processing

img2table v2.0.0 218.6K downloads/30d#9,338 on PyPI890
Permissive license MIT Active released

What it is and what it does

img2table is a Python library for identifying and extracting tables from images and PDF files. It uses OpenCV-based image processing to detect table boundaries and cell structures without relying on neural networks, making it lighter and more CPU-friendly than deep-learning alternatives. The library supports common image formats and PDFs, handles complex table structures like merged cells, and returns results as structured objects with Pandas DataFrame representations.

The package integrates with multiple OCR services—Tesseract, PaddleOCR, EasyOCR, docTR, RapidOCR, Surya, Google Vision, and AWS Textract—to extract text from detected table cells. Extracted tables can be exported to Excel while preserving their original structure. It requires numpy, pypdfium2, opencv-contrib-python, beautifulsoup4, and xlsxwriter as runtime dependencies.

Use it for:

  • Batch extract tables from scanned documents or screenshots for data analysis without manual re-entry
  • Convert PDF reports containing tabular data into structured Excel files for downstream processing
  • Automate table detection in document pipelines where neural network overhead is impractical
  • Parse invoice or receipt images to extract line-item tables for accounting systems
  • Build document ingestion workflows that preserve table formatting when converting to structured formats

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Identifies and extracts tables from images and PDF files using OpenCV-based image processing, with optional OCR integration to parse table content.

Yes, if you need lightweight table extraction from images or PDFs without deep-learning overhead. The MIT license, active maintenance, and broad OCR integration make it practical for production use. Install friction is moderate due to compiled dependencies, but pre-built wheels are available. No known vulnerabilities. Suitable for CPU-constrained environments and batch document processing.

Install

img2table on PyPI

pip

pip install img2table

uv

uv add img2table

poetry

poetry add img2table

Installing img2table

Before you install

Medium install friction due to compiled dependencies (opencv-contrib-python, pypdfium2). The package is actively maintained with recent releases and supports modern Python versions (3.10–3.13). Pre-built wheels available for common platforms reduce friction.

License in practice

MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install img2table

from img2table.document import Image
from img2table.ocr import TesseractOCR

image = Image("path/to/image.png")
ocr = TesseractOCR()
tables = image.extract_tables(ocr=ocr)

Tesseract-OCR must be installed separately on your system; alternatively, use one of the optional OCR backends (PaddleOCR, EasyOCR, etc.) via extras like `pip install img2table[paddle]`.

Verify before relying

  • Whether the package handles scanned documents with poor image quality or heavy distortion reliably
  • Performance characteristics when processing large PDF files or high-resolution images
  • Accuracy of table structure detection for complex layouts (nested tables, irregular cells)

Package facts

License MIT (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 5 — numpy, pypdfium2, opencv-contrib-python, beautifulsoup4, xlsxwriter
Maintenance actively maintained — 96 days since the last release
Last repo commit
First released
Downloads 218,583/month — #9,338 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: img2table-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl; img2table-2.0.0-cp310-cp310-macosx_11_0_arm64.whl; img2table-2.0.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; img2table-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; img2table-2.0.0-cp310-cp310-win32.whl; img2table-2.0.0-cp310-cp310-win_amd64.whl; img2table-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl; img2table-2.0.0-cp311-cp311-macosx_11_0_arm64.whl; img2table-2.0.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; img2table-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; img2table-2.0.0-cp311-cp311-win32.whl; img2table-2.0.0-cp311-cp311-win_amd64.whl; img2table-2.0.0-cp312-cp312-macosx_10_13_x86_64.whl; img2table-2.0.0-cp312-cp312-macosx_11_0_arm64.whl; img2table-2.0.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; img2table-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; img2table-2.0.0-cp312-cp312-win32.whl; img2table-2.0.0-cp312-cp312-win_amd64.whl; img2table-2.0.0-cp313-cp313-macosx_10_13_x86_64.whl; img2table-2.0.0-cp313-cp313-macosx_11_0_arm64.whl

Operating System :: OS IndependentProgramming Language :: Python :: 3 :: Only

Tags

table extraction from imagespdf table detectionextract tables from documentstable identification opencvocr table parsingimage to structured datadocument table recognition
document-processingtable-extractionocr-integration

More Information Analysis packages