# 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:
```bash
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:
```python
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:
```python
# 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**:
```python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/inquilabee/TableCV",
"name": "tablecv",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "opencv,opencv python,python table image,python table extraction",
"author": "Vishal Kumar Mishra",
"author_email": "vishal.k.mishra2@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d8/bd/9e2ed14c189d1a91288704e226e22788503318d137b4781e9c5ffaeeb8e7/tablecv-0.1.1.tar.gz",
"platform": null,
"description": "# TableCV\n\n**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.\n\n## Installation\n\nYou can easily install **TableCV** using pip:\n\n```bash\npip install tablecv\n```\n\n## Usage\n\n### Approach 1 (using PaddleOCR)\n\n**TableCV** offers a straightforward method to extract tables using PaddleOCR. This approach returns a pandas DataFrame object:\n\n```python\nfrom tablecv import extract_table\n\n# Replace \"image_path\" with the path to your image\nprint(extract_table(image_path=\"your_image.png\"))\n```\n\n### Approach 2 (OCR with Your Preferred Tool)\n\nIf 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:\n\n```python\n# List of tuples: (bounding box as (x, y, w, h), text)\nocr_results = [\n ((1, 2, 3, 4), \"a\"),\n ((4, 5, 6, 7), \"b\"),\n # Add more tuples as needed\n]\n```\n\nAfter obtaining your OCR results, you can extract tables from them using **TableCV**:\n\n```python\nfrom tablecv import extract_table_from_ocr\n\n# Replace \"ocr_results\" with your OCR results list\nprint(extract_table_from_ocr(ocr_results))\n```\n\nWith these two approaches, **TableCV** provides flexibility for table extraction from images, whether you prefer using PaddleOCR or another OCR tool of your choice.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Table extraction from image.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/inquilabee/TableCV",
"Repository": "https://github.com/inquilabee/TableCV"
},
"split_keywords": [
"opencv",
"opencv python",
"python table image",
"python table extraction"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9571c923ed0a731e3ea009c9fb69b23243bc9617844e710b75d06ad46f50d84c",
"md5": "55c3b20d1ec65be1005a0081fd2e56dc",
"sha256": "9603fcb9ef7a23704ce1b087c9b73a00ed0856e3b8eadfa3b1001a12febc652b"
},
"downloads": -1,
"filename": "tablecv-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "55c3b20d1ec65be1005a0081fd2e56dc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 7959,
"upload_time": "2023-09-14T21:40:46",
"upload_time_iso_8601": "2023-09-14T21:40:46.948068Z",
"url": "https://files.pythonhosted.org/packages/95/71/c923ed0a731e3ea009c9fb69b23243bc9617844e710b75d06ad46f50d84c/tablecv-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d8bd9e2ed14c189d1a91288704e226e22788503318d137b4781e9c5ffaeeb8e7",
"md5": "66833d29a2e69d8890d0a9e118fc4245",
"sha256": "d74e8e47c75b612f6fa29c12a85f37d55c6cccabd062f3a308042ffb422fe91e"
},
"downloads": -1,
"filename": "tablecv-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "66833d29a2e69d8890d0a9e118fc4245",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 6614,
"upload_time": "2023-09-14T21:40:48",
"upload_time_iso_8601": "2023-09-14T21:40:48.494496Z",
"url": "https://files.pythonhosted.org/packages/d8/bd/9e2ed14c189d1a91288704e226e22788503318d137b4781e9c5ffaeeb8e7/tablecv-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-14 21:40:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "inquilabee",
"github_project": "TableCV",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "tablecv"
}