--- id: img2table version: "2.0.0" license: MIT license_treatment: permissive maintenance: active --- # img2table — img2table is a table identification and extraction Python Library for PDF and images, based on OpenCV image processing License: permissive · Maintenance: active · Downloads: 218.6K/mo ## 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 above — 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 pip install img2table uv add img2table 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_current - Install friction: medium - Maintenance: active - Downloads: 218.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags table extraction from images, pdf table detection, extract tables from documents, table identification opencv, ocr table parsing, image to structured data, document table recognition, document-processing, table-extraction, ocr-integration [View on SkillFed](https://skillfed.io/packages/img2table) · [View on PyPI](https://pypi.org/project/img2table/)