Skip to content

chintanparekh2510/ai-expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Expense Tracker & Financial Advisor

An intelligent expense tracking system that uses OCR technology and AI-powered analysis to extract insights from receipts and provide personalized financial recommendations.

Features

Receipt Processing

  • OCR text extraction from images and PDFs
  • Multi-format support (JPG, PNG, PDF, WebP)
  • Intelligent expense parsing and categorization
  • Confidence scoring for data accuracy

AI-Powered Analysis

  • Automatic expense categorization
  • Spending pattern recognition
  • Anomaly detection for unusual expenses
  • Trend analysis across time periods

Financial Insights

  • Personalized budget recommendations
  • Money-saving opportunity identification
  • Spending health assessment
  • Goal tracking and progress monitoring

Interactive Dashboard

  • Real-time expense visualization
  • Category and merchant breakdowns
  • Interactive charts and graphs
  • Data export functionality

Installation

  1. Clone the repository:
git clone https://github.com/chintanparekh2510/ai-expense-tracker.git
cd ai-expense-tracker
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your OpenAI API key
  1. Install Tesseract OCR:
  • Windows: Download from GitHub
  • macOS: brew install tesseract
  • Linux: sudo apt-get install tesseract-ocr

Quick Start

  1. Run the web application:
streamlit run src/app.py
  1. Open your browser to http://localhost:8501

  2. Upload receipt images and view AI-generated insights

Project Structure

ai-expense-tracker/
├── src/
│   ├── ocr/              # Receipt processing and text extraction
│   ├── analysis/         # Expense analysis and pattern recognition
│   ├── advisor/          # AI budget recommendations and insights
│   ├── utils/            # Data handling and visualization utilities
│   └── app.py            # Main Streamlit application
├── data/
│   ├── sample/           # Sample data for testing
│   ├── receipts/         # User uploaded receipts
│   └── statements/       # Bank statements
├── tests/                # Unit tests
└── docs/                 # Documentation

Configuration

Environment Variables

OPENAI_API_KEY=your_openai_api_key_here
TESSERACT_PATH=/usr/bin/tesseract
OCR_LANGUAGE=eng
MAX_FILE_SIZE_MB=10

Supported File Formats

  • Images: JPG, JPEG, PNG, WebP, BMP, TIFF
  • Documents: PDF

Usage Examples

Command Line Analysis

from src.ocr.receipt_processor import ReceiptProcessor
from src.analysis.expense_analyzer import ExpenseAnalyzer

# Process receipt
processor = ReceiptProcessor()
results = processor.process_file("receipt.jpg")

# Analyze expenses
analyzer = ExpenseAnalyzer()
analyzer.add_expenses_batch(results)
summary = analyzer.get_spending_summary()

Web Interface

The Streamlit application provides:

  • File upload interface
  • Real-time processing feedback
  • Interactive visualizations
  • Export functionality

API Reference

OCR Module

  • ReceiptProcessor: Main OCR processing class
  • TextParser: AI-powered text parsing and structuring

Analysis Module

  • ExpenseAnalyzer: Core analysis engine
  • SpendingInsight: Insight data structure
  • SpendingTrend: Trend analysis results

Advisor Module

  • BudgetAdvisor: AI budget recommendations
  • InsightsGenerator: Personalized financial tips

Testing

Run the test suite:

python -m pytest tests/

Run demo analysis:

python demo.py

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Technical Requirements

  • Python 3.11+
  • OpenAI API access (for AI features)
  • Tesseract OCR installation
  • 4GB+ RAM recommended
  • CUDA GPU (optional, for enhanced processing)

Performance

  • OCR Processing: ~2-5 seconds per receipt
  • AI Analysis: ~1-3 seconds per expense
  • Batch Processing: Supports multiple files
  • Memory Usage: ~200MB base, +50MB per 1000 expenses

Support

For technical support or questions about implementation, please open an issue on GitHub.

Author

Created by Chintan Parekh - X | GitHub

Acknowledgments

  • OpenAI for GPT-4 API
  • Tesseract OCR project
  • Streamlit framework
  • Python data science ecosystem

About

AI-powered expense tracking system with OCR and financial analysis capabilities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages