Table Info Extractor
Table Info Extractor is a Python package designed for extracting tables from images and PDFs using OCR (Optical Character Recognition). It supports automatic rotation detection, image preprocessing, and conversion of extracted tables into pandas DataFrames.
Features
- Extract tables from images and PDFs.
- Automatically detect and correct image orientation.
- Enhance OCR results with preprocessing techniques (grayscale conversion, contrast enhancement, thresholding).
- Convert extracted tables into pandas DataFrames for easy data manipulation and analysis.
Installation
You can install Table Info Extractor via pip:
pip install table_info_extractor
Usage
Image To Table Extraction
from table_info_extractor import image_to_table_extract
# Example: Extract tables from an image
extracted_tables_from_image = image_to_table_extract("path_to_your_image.jpg", auto_rotation=True)
print(extracted_tables_from_image)
PDF To Table Extraction
from table_info_extractor import pdf_to_table_extract
# Example: Extract tables from a PDF
extracted_tables_from_pdf = pdf_to_table_extract("path_to_your_pdf.pdf", page_number=1, auto_rotation=True)
print(extracted_tables_from_pdf)
Function Documentation
image_to_table_extract(image_path, auto_rotation=False)
Extracts tables from an image file.
image_path(str): Path to the input image file.auto_rotation(bool): Whether to automatically correct image rotation.
Returns:
- List of pandas DataFrames, each representing a table extracted from the image.
pdf_to_table_extract(pdf_path, page_number, auto_rotation=False)
Extracts tables from a specific page of a PDF file.
pdf_path(str): Path to the input PDF file.page_number(int): Page number from which to extract tables (1-based index).auto_rotation(bool): Whether to automatically correct image rotation.
Returns:
- List of pandas DataFrames, each representing a table extracted from the PDF page.
Contribution
Contributions are welcome! To contribute to Table Info Extractor, please follow these steps:
- Fork the repository and clone it to your local machine.
- Create a new branch for your feature or bug fix:
git checkout -b feature/my-feature. - Make your changes and commit them with a descriptive message.
- Push your changes to the branch:
git push origin feature/my-feature. - Submit a pull request detailing your changes and why they should be included.
GitHub Repository
Metadata
Release files for table-info-extractor 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| table_info_extractor-0.1.2.tar.gz | 4.8 kB | Without provenance | Details for table_info_extractor-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| table_info_extractor-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for table_info_extractor-0.1.2-py3-none-any.whl |
Total release size: 10.2 kB
Release files / table_info_extractor-0.1.2.tar.gz
| Download URL | table_info_extractor-0.1.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2176266a078d4ce95c0ee767155f181561ada10b231532efb0810238c564dd9c
|
|
BLAKE2b-256 checksum How to use checksums |
9bff1b03ecb2fb9d6435338eb8c86385d38b0e386a860f24f62bbdcd739ae23c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.7
|
Release files / table_info_extractor-0.1.2-py3-none-any.whl
| Download URL | table_info_extractor-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6702832df034b9a8bd3da1f1c6cf2ab68bd3f9399c9dd96558baa3265cce7b4c
|
|
BLAKE2b-256 checksum How to use checksums |
00270bc57129773aa0a0db731d7ece05674394309e89fe9c3c75bd4d1e210d0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.7
|
Security for table-info-extractor 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.