Skip to main content

Detect and convert table image to html table

Project description

Table2HTML

A Python package that converts table images into HTML format using Object Detection model and OCR.

Installation

pip install table2html

Usage

from table2html import Table2HTML
import cv2

# Initialize
table2html = Table2HTML()

# Convert table image to HTML
image = cv2.imread("path/to/image.jpg")
cells, html = table2html(image)

# Save HTML output
with open('table.html', 'w') as f:
    f.write(html)

Input

  • image: numpy.ndarray (OpenCV/cv2 image format)

Outputs

  1. cells: List of dictionaries, where each dictionary represents a cell with:

    • row: int - Row index
    • column: int - Column index
    • box: Tuple[int] - Bounding box coordinates (x1, y1, x2, y2)
    • text: str - Cell text content
  2. html: str - HTML representation of the table

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

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

table2html-1.1.0.tar.gz (80.1 MB view details)

Uploaded Source

Built Distribution

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

table2html-1.1.0-py3-none-any.whl (80.1 MB view details)

Uploaded Python 3

File details

Details for the file table2html-1.1.0.tar.gz.

File metadata

  • Download URL: table2html-1.1.0.tar.gz
  • Upload date:
  • Size: 80.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for table2html-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b71d435676cab31503f136d82f3fd6e081addfebb082daf9b263e8e9f4027df1
MD5 33336fa59cc030ba6357262661f0d2bd
BLAKE2b-256 573f9218d98a2db4e65f9157acacb034e047dc827dd5b2b429407ecd4a365abd

See more details on using hashes here.

Provenance

The following attestation bundles were made for table2html-1.1.0.tar.gz:

Publisher: workflow.yml on jayllfpt/table2html

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file table2html-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: table2html-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 80.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for table2html-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 124179f9e9b27ff848ea70e6af74718d2b73fb93801b44ee5c6759ba565b4aec
MD5 eda5461763899c8d4f09760b35dbaa57
BLAKE2b-256 344ead70f4fb0f9d451af5aad64f9b346981c5ccdbae538018cb810387ebda07

See more details on using hashes here.

Provenance

The following attestation bundles were made for table2html-1.1.0-py3-none-any.whl:

Publisher: workflow.yml on jayllfpt/table2html

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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