img2table
img2table is a table identification and extraction Python Library for PDF and images, based on OpenCV image processing
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 img2tableuv
uv add img2tablepoetry
poetry add img2tableInstalling 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
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
kreuzbergExtracts text, tables, images, and metadata…
permissive · top 15,000 on PyPI
surya-ocrSurya is an OCR and document intelligence model…
permissive · top 5,000 on PyPI
camelot-pyExtracts tables from PDFs into pandas…
permissive · top 5,000 on PyPI
unstructured.pytesseractPython wrapper for Google's Tesseract OCR…
permissive · top 15,000 on PyPI
marker-pdfMarker converts PDFs, images, and other…
permissive · top 15,000 on PyPI
rapidocrRapidOCR extracts text from images using…
permissive · top 5,000 on PyPI
paddleocrPaddleOCR extracts text, tables, and structured…
permissive · top 5,000 on PyPI
amazon-textract-textractorTextractor wraps Amazon Textract APIs to…
permissive · top 5,000 on PyPI
pytesseractPytesseract wraps Google's Tesseract-OCR engine…
permissive · top 1,000 on PyPI
python-doctrpython-doctr extracts and localizes text from…
permissive · top 15,000 on PyPI