This system processes invoices using AI vision to extract data and generate insightful visualizations. It supports both PDF and image files (PNG format) as input.
Note that this can only process invoices that are one page long. Multiple pages are not supported, yet.
- PDF and image invoice processing
- AI-powered data extraction using Together API
- JSON data output
- Visualization of invoice trends
- Service amount analysis
- Support for multiple invoice items and services
- Python 3.8 or higher
- Together API key
- Clone the repository:
git clone <repository-url>
cd Invoice-Analyzer
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env
Edit .env
and add your Together API key.
- Place your invoices in the
invoices
directory (create if it doesn't exist) - Run the script:
python main.py
The script will:
- Process all invoices in the directory
- Generate JSON data for each invoice
- Create visualizations:
invoice_trend.png
: Timeline of invoice amountsservice_amounts.png
: Bar chart of amounts by service type- Note: You can change the name of the output files in the
main.py
file.
- Save all extracted data to
invoice_data.json
The system generates:
- Structured JSON data for each invoice in the
invoice_data.json
file - Trend analysis graphs
- Total amounts by service type
- Consolidated invoice data file
accounting-vlm/
├── main.py
├── requirements.txt
├── .env
├── .env.example
├── .gitignore
├── README.md
├── invoices/ # Place your invoices here
├── invoice_trend.png # Generated visualization
├── service_amounts.png # Generated visualization
└── invoice_data.json # Generated data
This project is licensed under the MIT License. Have fun, go wild!