Skip to main content

Table extraction from image.

Project description

TableCV

TableCV is a Python package designed to extract tables from images. It offers two approaches for extracting tables, allowing you to choose the one that best suits your needs.

Installation

You can easily install TableCV using pip:

pip install tablecv

Usage

Approach 1 (using PaddleOCR)

TableCV offers a straightforward method to extract tables using PaddleOCR. This approach returns a pandas DataFrame object:

from tablecv import extract_table

# Replace "image_path" with the path to your image
print(extract_table(image_path="your_image.png"))

Approach 2 (OCR with Your Preferred Tool)

If you prefer using a different OCR tool like EasyOCR, KerasOCR, or any other OCR solution, you can still use TableCV. First, perform OCR on your image using your chosen tool. The OCR results should be structured as a list of tuples, each containing a bounding box and corresponding text:

# List of tuples: (bounding box as (x, y, w, h), text)
ocr_results = [
    ((1, 2, 3, 4), "a"),
    ((4, 5, 6, 7), "b"),
    # Add more tuples as needed
]

After obtaining your OCR results, you can extract tables from them using TableCV:

from tablecv import extract_table_from_ocr

# Replace "ocr_results" with your OCR results list
print(extract_table_from_ocr(ocr_results))

With these two approaches, TableCV provides flexibility for table extraction from images, whether you prefer using PaddleOCR or another OCR tool of your choice.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tablecv-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tablecv-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file tablecv-0.1.1.tar.gz.

File metadata

  • Download URL: tablecv-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/6.2.0-1011-azure

File hashes

Hashes for tablecv-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d74e8e47c75b612f6fa29c12a85f37d55c6cccabd062f3a308042ffb422fe91e
MD5 66833d29a2e69d8890d0a9e118fc4245
BLAKE2b-256 d8bd9e2ed14c189d1a91288704e226e22788503318d137b4781e9c5ffaeeb8e7

See more details on using hashes here.

File details

Details for the file tablecv-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tablecv-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/6.2.0-1011-azure

File hashes

Hashes for tablecv-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9603fcb9ef7a23704ce1b087c9b73a00ed0856e3b8eadfa3b1001a12febc652b
MD5 55c3b20d1ec65be1005a0081fd2e56dc
BLAKE2b-256 9571c923ed0a731e3ea009c9fb69b23243bc9617844e710b75d06ad46f50d84c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page