Registry / data / img2table

img2table

JSON →
library2.0.0pypypi✓ verified 84d ago

img2table is a table identification and extraction library for PDFs and images, based on OpenCV image processing. Current version: 1.4.2. Supports Python 3.9-3.13. Released on PyPI with moderate cadence.

pip install img2table
INSTALL
IMPORT
SIG · IMG2TABLE
I
img2table
datapythonv2.0.0
Install
8.7s avg
Import
Disk
410MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.7s · import 0.000s · 316MB
410MB installed
● package 410MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OCR
from img2table.ocr import PaddleOCR, TesseractOCR
from img2table.ocr import PaddleOcr
Wrong casing; class is PaddleOCR (capital O, C, R).
Document
from img2table.document import Image, PDF
from img2table import Image
Image and PDF are classes inside img2table.document, not top-level.

Extract tables from an image using PaddleOCR.

import os from img2table.document import Image from img2table.ocr import PaddleOCR # Use environment variable for API key if needed ocr = PaddleOCR(lang='en', api_key=os.environ.get('PADDLE_OCR_KEY', '')) img = Image(src='table.png') tables = img.extract_tables(ocr=ocr) print(tables)
img2table --version
Debug
Known issues
breakingIn v1.4.0, the PDF backend was migrated from PyMuPDF/fitz to pypdfium2 for license compliance. Existing code expecting fitz will break.
fix
No action needed if using Document classes; only affects direct use of PDF library internals.
affects: >=1.4.0
deprecatedThe old TesseractOCR class used Tesseract 4.x; future versions may remove support. Recommended to migrate to PaddleOCR or SuryaOCR.
fix
Switch to PaddleOCR or SuryaOCR via pip install paddleocr or pip install surya-ocr (separate).
affects: <=1.4.2
gotchaOCR initialization is heavy; avoid recreating OCR instance per image in loops. Reuse the same OCR object for multiple documents.
fix
Create one OCR object and pass it to multiple extract_tables calls.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'paddleocr'
PaddleOCR is an extra dependency, not installed by default with img2table.
fix
pip install paddleocr
ImportError: cannot import name 'PaddleOCR' from 'img2table.ocr'
Using wrong casing; correct class name is PaddleOCR (capital O, C, R).
fix
Use: from img2table.ocr import PaddleOCR
AttributeError: 'Image' object has no attribute 'extract_tables'
Incorrect import; Image class is not in top-level package.
fix
Use: from img2table.document import Image
Upgrade
Version history
2.0.0latest on PyPI · released May 10, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
img2table — pip install img2table · libregistry