Skip to content

About

Automated PDF data extractor — extracts text, tables, images and smart fields from any PDF into labeled Excel files. Supports invoices, travel tickets, receipts, reports, forms and any document type with universal field detection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

PDF Data Extractor

Automated tool that extracts text, tables, images and smart fields from any PDF into clean, labeled Excel files.

Give it any PDF — invoices, travel tickets, receipts, reports, forms — and get a professional 5-sheet Excel file with all the important data extracted and labeled automatically.

Features

  • Universal Extraction — Works on any PDF type, not just specific formats
  • Smart Field Detection — Automatically identifies document type and extracts relevant fields
  • 5-Sheet Excel Output — Summary, Text, Tables, Images, and Clean Extracted Data
  • Batch Processing — Process entire folders of PDFs at once
  • OCR Support — Handles scanned/photo PDFs with Tesseract fallback
  • Product Detection — Extracts product names, quantities, prices from invoices
  • Image Extraction — Pulls out images with thumbnails embedded in Excel

Supported Document Types

Type Fields Extracted
Invoices Buyer name, Invoice #, Order ID, Products, Amounts, GST, Addresses
Travel Tickets PNR, Train/Flight #, From/To, Date, Passenger, Fare, Seat
Receipts Transaction ID, Store, Date, Total, Payment Method
Reports Title, Author, Date, Sections
Forms All label-value pairs
Any PDF Key-value pairs, dates, amounts, names, phones, emails, addresses

Installation

pip install -r requirements.txt

For scanned PDF support (optional):

Usage

Single File

python main.py invoice.pdf

Multiple Files

python main.py file1.pdf file2.pdf file3.pdf

Entire Folder

python main.py --folder "path/to/pdfs"

Custom Output

python main.py invoice.pdf -o result.xlsx
python main.py --folder pdfs/ --output-dir results/

Options

python main.py --help

Options:
  pdf_paths          One or more PDF file paths
  --folder           Folder containing PDF files to process
  -o, --output       Output Excel file path (single file mode)
  --output-dir       Output directory for batch mode
  --no-images        Skip image extraction (faster)
  --no-ocr           Skip OCR fallback for scanned PDFs

Excel Output (5 Sheets)

Sheet Contents
Summary Document metadata + all detected fields
Text Content Page-by-page raw text
Tables All tables extracted from the PDF
Images Embedded thumbnails with metadata
Extracted Data Clean, labeled fields ready to use

Tech Stack

Library Purpose
pdfplumber Text and table extraction
PyMuPDF Image extraction and metadata
pytesseract OCR for scanned PDFs
openpyxl Excel file generation
Pillow Image processing
pandas Table data handling

Project Structure

pdf-data-extractor/
├── main.py              # CLI entry point (single + batch)
├── pdf_extractor.py     # Core extraction (text, tables, images)
├── smart_parser.py      # Document type detection + field extraction
├── excel_exporter.py    # 5-sheet Excel output with formatting
└── requirements.txt     # Python dependencies

How It Works

PDF File
  │
  ▼
pdf_extractor.py ──→ Extracts raw text, tables, images, metadata
  │
  ▼
smart_parser.py ───→ Detects document type + extracts labeled fields
  │
  ▼
excel_exporter.py ─→ Creates professional 5-sheet Excel file
  │
  ▼
Clean Excel Output

License

MIT

About

Automated PDF data extractor — extracts text, tables, images and smart fields from any PDF into labeled Excel files. Supports invoices, travel tickets, receipts, reports, forms and any document type with universal field detection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages