Skip to content

cadusk/toll-statement-crew

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toll Statement Crew

A CrewAI multi-agent system for processing Indiana Toll Road statement PDFs.

Overview

This project uses three specialized AI agents to:

  1. Extract transaction data from toll statement PDFs
  2. Analyze and group transactions by date
  3. Generate filtered PDF statements with redacted non-matching transactions

Installation

cd toll_statement_crew
uv sync

Configuration

Create a .env file with your LLM provider credentials:

Option 1: OpenAI

cp .env.example .env
# Edit .env with your OpenAI credentials
OPENAI_API_KEY=sk-your-key-here
OPENAI_MODEL_NAME=gpt-4o-mini

Option 2: Azure OpenAI

First install Azure support:

uv add "crewai[azure-ai-inference]"

Then configure .env:

AZURE_API_KEY=your-azure-key
AZURE_API_BASE=https://your-resource.openai.azure.com
AZURE_API_VERSION=2025-01-01-preview
OPENAI_MODEL_NAME=azure/your-deployment-name

Usage

# Run with default settings
uv run toll_statement_crew path/to/statement.pdf

# Specify output directory
uv run toll_statement_crew path/to/statement.pdf --output-dir ./output

# Additional options
uv run toll_statement_crew path/to/statement.pdf \
    --output-dir ./output \
    --redaction-color grey \
    --text-color black \
    --date-field posted \
    --types "Toll charge,Away toll charge"

Options

Option Description Default
--output-dir Output directory for generated PDFs ./output
--redaction-color Color for redaction bars (black, grey) black
--text-color Color for updated totals (red, black) red
--no-bold Disable bold font for updated text False
--date-field Group by transaction or posted date transaction
--types Transaction types to include (comma-separated) "Toll charge,Away toll charge"

Agents

PDF Extraction Specialist

Extracts and parses all transaction data from toll statement PDFs using pdfplumber.

Transaction Analyzer

Groups transactions by date, filters by type, and calculates totals for each date.

PDF Report Generator

Creates professionally redacted PDF statements with accurate totals using pypdf and reportlab.

Project Structure

toll_statement_crew/
├── pyproject.toml
├── .env
└── src/
    └── toll_statement_crew/
        ├── main.py           # CLI entry point
        ├── crew.py           # Crew orchestration
        ├── core/
        │   └── pdf_processor.py  # Core PDF processing logic
        ├── tools/
        │   ├── extraction_tools.py
        │   ├── analysis_tools.py
        │   └── generation_tools.py
        └── config/
            ├── agents.yaml
            └── tasks.yaml

About

Crew to process toll statements for expense reports.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages