A comprehensive web-based budget tracking application built with Streamlit, featuring Excel data integration and AI-powered financial insights. Perfect for personal finance management with intelligent categorization and analysis.
Note: Add your own OpenAI API key to enable AI features
- π» Interactive Web Dashboard: Modern, responsive web interface
- π Excel Integration: Store and manage data in Excel files (works like a database)
- π Real-time Charts: Interactive visualizations with Plotly
- π€ AI-Powered Analysis: Intelligent spending insights using OpenAI GPT
- π Data Management: Upload/download Excel files, filter and view data
- π·οΈ Expense Categorization: Automatic AI categorization of expenses
- π― Financial Goal Setting: Track progress toward financial objectives
- π€ First-Time User Setup: Guided onboarding with financial profile creation
- π Multiple Data Views: View data by All Time, Current Month, or Current Year
- π¨ Improved Navigation: Clean, vertical list navigation in sidebar
- πΎ User Profile Storage: Personal financial goals and preferences in Excel
- π± Mobile-Friendly: Responsive design that works on all devices
git clone https://github.com/yourusername/ai-budget-tracker.git
cd ai-budget-tracker# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory:
cp .env.example .envThen edit .env and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_hereNote: The app works without an API key, but AI features (categorization, analysis) will be disabled.
python sample_data.pyTip: You can also generate sample data from within the app during first-time setup!
Option A: Using batch file (Windows)
run_app.batOption B: Direct command
streamlit run streamlit_app.pyOption C: Using Python
python -m streamlit run streamlit_app.pyThe app will automatically open in your browser at http://localhost:8501
-
π Dashboard
- Key financial metrics (Balance, Income, Expenses)
- Interactive charts (Pie chart, Bar chart, Trend analysis)
- Recent transactions view
- Visual analytics overview
-
β Add Transaction
- Add income or expense transactions
- AI-powered expense categorization
- Date and amount input
- Real-time data updates
-
π€ AI Analysis
- AI-powered spending analysis
- Personalized budget recommendations
- Financial pattern insights
- Smart recommendations based on spending habits
-
π Data Management
- View all transactions with filters
- Upload Excel files
- Download data as Excel or CSV
- Data import/export functionality
- π Database-like Storage: Excel files with data integrity and validation
- π₯ Smart Import: Upload existing Excel files with automatic format detection
- π€ Flexible Export: Download data in Excel or CSV with period-specific naming
- π External Compatibility: Standard Excel format for editing in Microsoft Excel, Google Sheets, etc.
- Expense Pie Chart: Visual breakdown of spending by category
- Monthly Trends: Income vs expenses over time
- Running Balance: Balance progression over time
- Category Analysis: Horizontal bar chart of spending categories
- π·οΈ Smart Categorization: Automatic expense categorization using GPT-3.5-turbo
- π Spending Analysis: AI-generated insights about spending patterns and trends
- π‘ Budget Recommendations: Personalized budget advice using 50/30/20 rule
- π― Financial Coaching: Intelligent suggestions for financial improvement and goal achievement
ai-budget-tracker/
βββ π streamlit_app.py # Main Streamlit application
βββ π budget_tracker_web.py # Core budget tracking logic
βββ π create_base_database.py # Database initialization script
βββ π sample_data.py # Generate sample data for testing
βββ π run_app.bat # Windows batch file to run the app
βββ π requirements.txt # Python dependencies
βββ π .env.example # Environment variables template
βββ π .gitignore # Git ignore file
βββ π LICENSE # MIT License
βββ π README.md # This file
βββ π docs/ # Documentation and screenshots
βββ π *.xlsx # Excel data files (auto-generated, git-ignored)
- Complete Setup: The app will guide you through initial setup on first launch
- Add Sample Data: Use the "Add Sample Data" button to explore features
- Set Financial Goals: Input your income, savings goals, and expense limits
- Time Period Views: Switch between All Time, Current Month, and Current Year views
- Data Export: Download your data in Excel or CSV format with period-specific filenames
- AI Features: Set your OpenAI API key for intelligent expense categorization and analysis
- Data Import: Upload existing Excel files with columns: type, amount, description, category, date
- Responsive Design: Works seamlessly on phones and tablets
- Touch-Friendly: All buttons and interactions optimized for mobile
When importing Excel files, ensure the following columns:
type: "income" or "expense"amount: Numerical valuedescription: Text description of the transactioncategory: Category namedate: Date in YYYY-MM-DD format
Common Issues & Solutions
- Module Import Errors: Ensure virtual environment is activated and dependencies installed
- Python Version: Requires Python 3.7 or higher
- Streamlit Issues: Try
pip install --upgrade streamlit
- AI Not Working: Verify OPENAI_API_KEY is set in
.envfile - Categories Show "Other": API key may be invalid or OpenAI service unavailable
- Excel Import Fails: Ensure columns are named: type, amount, description, category, date
- Date Format Issues: Use YYYY-MM-DD format or Excel date format
- Large Files: App handles thousands of transactions efficiently
- Slow Loading: First load creates database files automatically
- Port Issues: Streamlit auto-finds available ports (usually 8501-8510)
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Commit:
git commit -am 'Add new feature' - Push:
git push origin feature-name - Submit a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Streamlit - For the amazing web app framework
- Plotly - For beautiful, interactive charts
- OpenAI - For AI-powered financial insights
- Pandas & Openpyxl - For robust Excel data handling
Technical Features
- π Fast Loading: Streamlit caching for instant data access
- π Efficient Charts: Optimized Plotly rendering
- πΎ Smart Storage: Excel files work like a database with integrity checks
- π Real-time Updates: Changes reflect immediately across all pages
- β Data Validation: Automatic validation and correction of imported data
- π Data Integrity: ID uniqueness and proper sequencing maintained
- π€ Export Options: Multiple formats (Excel, CSV) with smart naming
- π Advanced Filtering: Dynamic filtering by date, category, and type
- π± Mobile-First: Responsive design for all devices
- π¨ Modern UI: Clean, intuitive interface with proper spacing
- βΏ Accessibility: Screen reader friendly with proper labels
- π Cross-Platform: Works on Windows, macOS, and Linux
π οΈ Built with: Streamlit β’ Plotly β’ Pandas β’ OpenAI API β’ Openpyxl
π₯οΈ Compatible with: Windows β’ macOS β’ Linux
π Python Version: 3.7+
β If this project helps you, please give it a star! β
