invoice2data  by invoice-x

Invoice data extraction for accounting

Created 11 years ago
2,175 stars

Top 20.0% on SourcePulse

GitHubView on GitHub
Project Summary

invoice2data is a command-line tool and Python library designed to automate the extraction of structured data from PDF invoices, catering to businesses and developers who process large volumes of financial documents. It significantly reduces manual data entry, saving time and minimizing errors by transforming unstructured invoice PDFs into machine-readable formats like CSV, JSON, or XML.

How It Works

The system employs a flexible, cascading pipeline for data extraction. It begins with pluggable backends to extract raw text from PDFs, supporting options like pdfium (default, no system dependencies), pdftotext, pdfminer, pdfplumber, and various OCR engines (Tesseract, docTR, etc.). Following text extraction, a powerful YAML or JSON-based template system uses regular expressions to identify and structure key information, with an optional AI fallback for handling novel invoice layouts or generating templates.

Quick Start & Requirements

Installation is straightforward via pip: `pip install invoice2data`. To use from the command line, run `invoice2data invoice.pdf` for CSV output, or specify `--output-format json` or `--output-format xml`. As a Python library, import and use: `from invoice2data import extract_data; result = extract_data("invoice.pdf")`. No system libraries are required by default. Optional backends and extras are detailed in the installation guide.

Full documentation is available at: https://invoice2data.readthedocs.io/

Highlighted Details

  • Pluggable text extraction backends, including OCR options, offer flexibility in handling diverse PDF types.
  • A robust template system allows precise content matching, definition of static and custom fields, multiple regex per field, and specialized line-item parsing via the `lines-plugin`.
  • An optional AI fallback assists in parameter guessing and template generation for new invoice formats.
  • Outputs structured data into CSV, JSON, or XML formats, or can rename PDF files based on extracted content.

Maintenance & Community

The project is maintained by Manuel Riel and Alexis de Lattre. Notable contributions include work by Harshit Joshi (Google Summer of Code) and Holger Brunn (invoice item parsing). A contributor guide is available for those interested in development.

Licensing & Compatibility

The license is not explicitly stated in the provided README, which requires clarification for adoption decisions, especially concerning commercial use or integration into proprietary systems.

Limitations & Caveats

The roadmap indicates ongoing development for features such as integrating online OCR services and applying machine learning for automatic parameter and template guessing, suggesting these capabilities may be limited or experimental in the current version. The lack of an explicit license is a significant adoption blocker.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
11
Issues (30d)
0
Star History
20 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Jerry Liu Jerry Liu(Cofounder of LlamaIndex), and
1 more.

sparrow by katanaml

0.1%
5k
Data processing & instruction calling tool using ML, LLM, and Vision LLM
Created 4 years ago
Updated 1 week ago
Feedback? Help us improve.