Skip to main content

A tool to extract text and tables from PDF files

Project description

To make your README.md display correctly on PyPI, it must:

  1. Use valid Markdown syntax only (no reStructuredText).
  2. Avoid GitHub-style emojis () which may not render correctly on PyPI.
  3. Reference valid links (PyPI doesn’t support javascript: or broken URLs).
  4. Be UTF-8 encoded and declared properly in setup.py.

✅ Cleaned & PyPI-Ready Version (Key Edits Only)

Here's an updated version of your README.md, cleaned and styled for PyPI compatibility:


# PDF Table and Text Extraction Tool

## Overview
This Python tool extracts tables and text from scanned PDF documents using advanced computer vision and Optical Character Recognition (OCR) techniques. It separates table regions from text, processes them individually, and outputs structured results.

## Features
- Intelligent Table Detection using OpenCV
- OCR-based Text Extraction (via Tesseract)
- Supports output formats: CSV, JSON, XLSX, and PDF
- Easy-to-use Command-Line Interface (CLI)
- Logging to file and console
- Error Handling and Input Validation
- Configurable DPI, output format, and file naming

## Installation

Install from PyPI:

```bash
pip install pypdf2extractor

Or clone the repo:

git clone https://github.com/sathu08/pypdf2extractor.git
cd pypdf2extractor
pip install .

System Dependencies

Tesseract OCR

Windows Download from: Tesseract releases Add install folder to system PATH.

Linux

sudo apt install tesseract-ocr

macOS

brew install tesseract

Poppler

Windows Download from: poppler-windows Add bin/ to PATH.

Linux

sudo apt install poppler-utils

macOS

brew install poppler

CLI Usage

Basic

pypdf2extractor input.pdf

Advanced

pypdf2extractor input.pdf --output results --format xlsx --dpi 300

All Options

pypdf2extractor [PDF_FILE] [OPTIONS]

Options:
  -o, --output DIR         Output directory
  -f, --filename NAME      Output filename (no extension)
  --format FORMAT          csv, json, xlsx, pdf
  --dpi DPI                PDF resolution (default: 300)
  -v, --verbose            Verbose logging
  -h, --help               Show help

Programmatic Usage

from pypdf2extractor import extractor

extractor.main()

Output Formats

Format Description
CSV Spreadsheet compatible
JSON For APIs/web
XLSX For reporting
PDF Final formatted file

Requirements

Python 3.10+

Python Packages See requirements.txt, including:

  • opencv-python
  • numpy
  • pandas
  • pytesseract
  • pdf2image
  • tabulate
  • xhtml2pdf

System Tools

  • Tesseract OCR
  • Poppler

Troubleshooting

Tesseract not found

Make sure it's installed and available in PATH:

tesseract --version

Poppler errors

Ensure pdftoppm is in your system's PATH.

Performance Tips

  • Use --dpi 200 for faster results
  • Use --verbose to see logs

License

MIT License

Support

Please raise issues on the GitHub repository.

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

pypdf2extractor-0.2.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

pypdf2extractor-0.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file pypdf2extractor-0.2.0.tar.gz.

File metadata

  • Download URL: pypdf2extractor-0.2.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pypdf2extractor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1d781b70b8d259035750d40b163f3cc5eb930944ac5019e5d5399d4b113523f1
MD5 a6513214f10a9c1b7903bedd3d626d81
BLAKE2b-256 879d250ec9c102363f357fa748efa32f8e24dfb66bfe0e2bae9d2fa64c39de72

See more details on using hashes here.

File details

Details for the file pypdf2extractor-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pypdf2extractor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7af42ad2f2db2543faa0d1acd96cdec064b6711356be68bec881231ac8e38b6f
MD5 eb8d0fb14853974d17adf600615d78f9
BLAKE2b-256 8e46e3267a6adb57d47185f6683cf23864623618fbf810277180d5ddf986adef

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