Smart Expense Tracker Development

Fatuade Miracle

Fatuade Miracle

πŸ’Έ Smart Expense Tracker

A simple, Python project that helps you track your expenses using Google Sheets and sends email alerts when your spending exceeds a certain limit.
This project is perfect for freelancers, students, or anyone who wants to keep their finances in check with automation!

Features

Stores expenses in Google Sheets
Analyzes spending over the last 7 days
Sends automatic email alerts if you overspend
Keeps your credentials safe using .env files
Easy to test and run in Google Colab

Technologies Used

Python 3
Google Sheets API
Gmail SMTP (for email alerts)
Google Colab (for running it online)
dotenv (.env file to hide sensitive info)

How to Use This Project

STEP 1: Set Up Google Sheets API

Create a new project
Enable the Google Sheets API
Create Service Account credentials
Download the JSON file β†’ rename to google_credentials.json
Share your Google Sheet with the generated service email

STEP 2: Prepare Your Google Sheet

Create a new Google Sheet
Name the sheet tab (e.g. Expenses)
Add this header row in the first row: Date | Category | Description | Amount
Start adding sample data.

STEP 3: Add Your .env File

Create a .env file with: EMAIL_ADDRESS=your_email@gmail.com EMAIL_PASSWORD=your_app_password SHEET_ID=your_google_sheet_id BUDGET_LIMIT=20000
Tip: Use an App Password if you have 2FA on your Gmail.

STEP 4: Run the App (Google Colab or Locally)

You can use main.py to run everything at once.
python main.py
It will:
Fetch the data
Analyze your last 7 days' expenses
Send you an alert if you’ve gone above your limit

Project Structure
smart-expense-tracker/
β”‚
β”œβ”€β”€ main.py # Entry point to run the full tracker
β”œβ”€β”€ config.py # Loads API keys and env vars
β”œβ”€β”€ fetch_data.py # Gets data from your Google Sheet
β”œβ”€β”€ analyze_data.py # Checks your spending patterns
β”œβ”€β”€ send_email.py # Sends alert if you overspent
β”œβ”€β”€ sheet_utils.py # Sheet helper functions
β”œβ”€β”€ .env # Secret keys (not shared on GitHub)
β”œβ”€β”€ README.md # You're reading this!
β”œβ”€β”€ google_credentials.json # Google API credentials

Author
Built by Fatuade Miracle
Like this project

Posted Jul 31, 2025

Created a Python expense tracker using Google Sheets and email alerts.