{"id":21456,"library":"img2table","title":"img2table","description":"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.","status":"active","version":"1.4.2","language":"python","source_language":"en","source_url":"https://github.com/xavctn/img2table","tags":["table extraction","OCR","PDF","image processing","OpenCV"],"install":[{"cmd":"pip install img2table","lang":"bash","label":"Install base library"}],"dependencies":[],"imports":[{"note":"Wrong casing; class is PaddleOCR (capital O, C, R).","wrong":"from img2table.ocr import PaddleOcr","symbol":"OCR","correct":"from img2table.ocr import PaddleOCR, TesseractOCR"},{"note":"Image and PDF are classes inside img2table.document, not top-level.","wrong":"from img2table import Image","symbol":"Document","correct":"from img2table.document import Image, PDF"}],"quickstart":{"code":"import os\nfrom img2table.document import Image\nfrom img2table.ocr import PaddleOCR\n\n# Use environment variable for API key if needed\nocr = PaddleOCR(lang='en', api_key=os.environ.get('PADDLE_OCR_KEY', ''))\n\nimg = Image(src='table.png')\ntables = img.extract_tables(ocr=ocr)\nprint(tables)","lang":"python","description":"Extract tables from an image using PaddleOCR."},"warnings":[{"fix":"No action needed if using Document classes; only affects direct use of PDF library internals.","message":"In v1.4.0, the PDF backend was migrated from PyMuPDF/fitz to pypdfium2 for license compliance. Existing code expecting fitz will break.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Switch to PaddleOCR or SuryaOCR via pip install paddleocr or pip install surya-ocr (separate).","message":"The old TesseractOCR class used Tesseract 4.x; future versions may remove support. Recommended to migrate to PaddleOCR or SuryaOCR.","severity":"deprecated","affected_versions":"<=1.4.2"},{"fix":"Create one OCR object and pass it to multiple extract_tables calls.","message":"OCR initialization is heavy; avoid recreating OCR instance per image in loops. Reuse the same OCR object for multiple documents.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-3.13':25 '1.4.2':21 '3.9':24 'base':14 'cadenc':31 'current':19 'extract':8,33 'identif':6 'imag':13,17,36 'img2table':1,2 'librari':9 'moder':30 'ocr':34 'opencv':16,38 'pdf':35 'pdfs':11 'process':18,37 'pypi':28 'python':23 'releas':26 'support':22 'tabl':5,32 'version':20","created_at":"2026-04-27T17:00:00.341851+00:00","updated_at":"2026-04-27T17:00:00.341851+00:00","problems":[{"fix":"pip install paddleocr","cause":"PaddleOCR is an extra dependency, not installed by default with img2table.","error":"ModuleNotFoundError: No module named 'paddleocr'"},{"fix":"Use: from img2table.ocr import PaddleOCR","cause":"Using wrong casing; correct class name is PaddleOCR (capital O, C, R).","error":"ImportError: cannot import name 'PaddleOCR' from 'img2table.ocr'"},{"fix":"Use: from img2table.document import Image","cause":"Incorrect import; Image class is not in top-level package.","error":"AttributeError: 'Image' object has no attribute 'extract_tables'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.0.0","cli_name":"img2table","cli_version":"sh: 1: img2table: not found","type":"library","homepage":null,"github":"https://github.com/xavctn/img2table","docs":null,"changelog":null,"pypi":"https://pypi.org/project/img2table/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}