An intelligent expense tracking system that uses OCR technology and AI-powered analysis to extract insights from receipts and provide personalized financial recommendations.
- OCR text extraction from images and PDFs
- Multi-format support (JPG, PNG, PDF, WebP)
- Intelligent expense parsing and categorization
- Confidence scoring for data accuracy
- Automatic expense categorization
- Spending pattern recognition
- Anomaly detection for unusual expenses
- Trend analysis across time periods
- Personalized budget recommendations
- Money-saving opportunity identification
- Spending health assessment
- Goal tracking and progress monitoring
- Real-time expense visualization
- Category and merchant breakdowns
- Interactive charts and graphs
- Data export functionality
- Clone the repository:
git clone https://github.com/chintanparekh2510/ai-expense-tracker.git
cd ai-expense-tracker- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .env
# Edit .env with your OpenAI API key- Install Tesseract OCR:
- Windows: Download from GitHub
- macOS:
brew install tesseract - Linux:
sudo apt-get install tesseract-ocr
- Run the web application:
streamlit run src/app.py-
Open your browser to
http://localhost:8501 -
Upload receipt images and view AI-generated insights
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
OPENAI_API_KEY=your_openai_api_key_here
TESSERACT_PATH=/usr/bin/tesseract
OCR_LANGUAGE=eng
MAX_FILE_SIZE_MB=10- Images: JPG, JPEG, PNG, WebP, BMP, TIFF
- Documents: PDF
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()The Streamlit application provides:
- File upload interface
- Real-time processing feedback
- Interactive visualizations
- Export functionality
ReceiptProcessor: Main OCR processing classTextParser: AI-powered text parsing and structuring
ExpenseAnalyzer: Core analysis engineSpendingInsight: Insight data structureSpendingTrend: Trend analysis results
BudgetAdvisor: AI budget recommendationsInsightsGenerator: Personalized financial tips
Run the test suite:
python -m pytest tests/Run demo analysis:
python demo.py- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License. See the LICENSE file for details.
- Python 3.11+
- OpenAI API access (for AI features)
- Tesseract OCR installation
- 4GB+ RAM recommended
- CUDA GPU (optional, for enhanced processing)
- 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
For technical support or questions about implementation, please open an issue on GitHub.
Created by Chintan Parekh - X | GitHub
- OpenAI for GPT-4 API
- Tesseract OCR project
- Streamlit framework
- Python data science ecosystem