InvoiceFlow: convert PDF invoices to Excel, at batch scale
InvoiceFlow takes a folder of PDF invoices and produces a clean, structured, multi-sheet Excel workbook — invoice headers on one sheet, line items on another — using parallel extraction and a parser layer built to swap in OCR later.
The problem it solves
Finance and operations teams routinely receive invoices as PDFs and need them as rows in a spreadsheet — for reconciliation, reporting, or import into another system. Doing that by hand is slow and error-prone. Most quick scripts handle one invoice layout and fall apart on the second. InvoiceFlow is built the other way around: a batch pipeline, with extraction isolated behind a strategy interface so new formats and methods slot in without rewriting the core.
What it does
- Extracts structured data from PDF invoices — invoice number, date, parties, and line items.
- Exports multi-sheet Excel workbooks — one sheet for invoice-level fields, a separate sheet for line items, ready for pivot tables and formulas.
- Generates realistic demo invoices with Faker and ReportLab, so you can test the pipeline at any volume without real documents.
- Runs in parallel via
ProcessPoolExecutor, with a benchmark command that reports throughput in PDFs per second. - Configurable and observable — environment-based configuration, rotating file logs, and a sequential mode for debugging.
How it works
The pipeline is a clean chain of responsibilities:
- CLI layer (
app.py) — parses arguments and routes thegenerate,processandbenchmarkcommands. - Pipeline — discovers PDFs, coordinates workers, and drives Excel generation.
- Parser — pulls raw text out of each PDF. This layer is deliberately thin so an OCR backend can replace it.
- Extractor strategy — maps raw text to an
InvoiceDatamodel. Implement aBaseExtractorsubclass to support a new invoice layout or extraction method without touching anything else. - Worker — runs extraction sequentially or across processes.
- Exporter — converts the collected
InvoiceDatainto a formatted, multi-sheet workbook.
Install
Requires Python 3.10 or newer.
git clone https://github.com/i95compile/PDF2Excel-Invoices.git
cd PDF2Excel-Invoices
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
Usage
Generate a batch of demo invoices to work with:
python app.py generate --count 500 --output invoices/
Convert a folder of PDF invoices to Excel:
python app.py process --input invoices --output output/result.xlsx --workers auto
The process command accepts --workers (auto or an integer) and --mode (sequential or multiprocessing). The output workbook has a sheet for invoice-level data and a sheet for line items.
Benchmark throughput on your machine:
python app.py benchmark --input invoices --workers auto
This reports PDFs per second, elapsed time and optional CPU usage, and writes a JSON report.
Configuration
Settings resolve in three tiers — a .env file, defaults in config.py, and OS environment variables. Common keys: LOG_LEVEL, WORKERS, PROCESSING_MODE, and the input/output directory paths.
Extending it
The extractor is a strategy: subclass BaseExtractor, implement the mapping from raw PDF text to InvoiceData, and register it — no pipeline changes. The parser layer is isolated for the same reason, so OCR or an AI extraction backend can be dropped in. The documented roadmap includes OCR, AI extraction, CSV/JSON output, a REST API and a GUI.
Tech stack
Python · pdfplumber · pandas · openpyxl · ReportLab · Faker · ProcessPoolExecutor · pytest
FAQ
How do I convert PDF invoices to Excel with InvoiceFlow?
Clone the repo, install the requirements, then run python app.py process --input invoices --output output/result.xlsx --workers auto. It reads every PDF in the input folder, extracts structured invoice data, and writes a multi-sheet Excel workbook.
Does it handle scanned or image-only invoices?
Version 0.1.0 extracts text from digital PDFs. The parser layer is isolated so an OCR backend can be substituted without changing the pipeline; OCR and AI extraction are on the roadmap.
Is InvoiceFlow free?
Yes — it is open source and free to use. The source is on GitHub.
Can it process large batches quickly?
Yes. Extraction runs in parallel across CPU cores via ProcessPoolExecutor, and the benchmark command reports throughput in PDFs per second.
Need this adapted to your own invoice formats, wired into an existing system, or extended with OCR for scanned documents? That is the kind of work I do. Start a conversation — or read more about how I approach business process automation.