Skip to content

widgetwalker/personal_financer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฐ Personal Financer

Python SQLite Pandas License

A powerful Python tool for personal finance management with transaction tracking, category-wise analysis, and CSV export capabilities. Built with SQLite for efficient data storage and Pandas for advanced analytics.


โœจ Features

  • ๐Ÿ’ณ Transaction Management - Add, view, edit, and delete transactions
  • ๐Ÿ“Š Category Organization - Organize by income, expenses, or savings
  • ๐Ÿ“ˆ Financial Summaries - Monthly and category-wise reports
  • ๐Ÿ“ CSV Export - Export data for external analysis
  • ๐Ÿ’พ SQLite Database - Reliable, lightweight data storage
  • ๐Ÿ“‰ Data Visualization - Charts and graphs for spending patterns
  • ๐Ÿ”„ Modular Design - Easy integration with custom applications
  • ๐ŸŽฏ Developer-Friendly - Clean API for programmatic access

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Installation

# Clone the repository
git clone https://github.com/widgetwalker/personal_financer.git
cd personal_financer

# Install dependencies
pip install pandas matplotlib

Run the Application

# Run main application
python main.py

# Or use the data handler directly
python data_handler.py

๐Ÿ“ฆ Dependencies

pandas>=1.5.0
matplotlib>=3.6.0
sqlite3 (included with Python)

๐ŸŽฎ Usage

Interactive CLI

python main.py

Follow the menu prompts to:

  • Add new transactions
  • View transaction history
  • Generate summaries
  • Export to CSV

Programmatic API

from data_handler import FinanceDataHandler

# Initialize handler
handler = FinanceDataHandler()

# Add transaction
handler.add_transaction(
    date="2025-04-20",
    amount=100.50,
    category="Salary",
    type="Income"
)

# Get monthly summary
summary = handler.get_monthly_summary(month="04", year="2025")

# Export to CSV
handler.export_to_csv("transactions.csv")

๐Ÿ“‚ Project Structure

personal_financer/
โ”œโ”€โ”€ main.py                  # Main application with CLI interface
โ”œโ”€โ”€ data_handler.py          # Core transaction management logic
โ”œโ”€โ”€ db_setup.py              # Database initialization
โ”œโ”€โ”€ visualizer.py            # Data visualization utilities
โ”œโ”€โ”€ finance.db               # SQLite database (auto-created)
โ”œโ”€โ”€ finance_tracker.db       # Backup database
โ””โ”€โ”€ README.md                # This file

๐Ÿ”ง Core Components

FinanceDataHandler

Main class for transaction management:

  • add_transaction() - Add new transaction
  • get_all_transactions() - Retrieve all records
  • update_transaction() - Modify existing transaction
  • delete_transaction() - Remove transaction
  • get_monthly_summary() - Generate monthly report
  • get_category_summary() - Analyze by category
  • export_to_csv() - Export data

Database Schema

CREATE TABLE transactions (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    date TEXT NOT NULL,
    amount REAL NOT NULL,
    category TEXT NOT NULL,
    type TEXT NOT NULL,
    description TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

๐Ÿ“Š Features in Detail

Transaction Categories

  • Income: Salary, Freelance, Investments, Other
  • Expenses: Groceries, Utilities, Rent, Entertainment, Transport
  • Savings: Emergency Fund, Retirement, Goals

Summary Reports

  • Monthly: Total income, expenses, and savings per month
  • Category-wise: Spending breakdown by category
  • Yearly: Annual financial overview
  • Custom: Filter by date range or category

Data Export

  • CSV Format: Compatible with Excel, Google Sheets
  • Filtered Exports: Export specific date ranges or categories
  • Backup: Regular database backups

๐ŸŽจ Visualization

from visualizer import FinanceVisualizer

viz = FinanceVisualizer()

# Generate spending pie chart
viz.plot_category_distribution()

# Create monthly trend line
viz.plot_monthly_trends()

# Compare income vs expenses
viz.plot_income_vs_expenses()

๐Ÿ’ก Use Cases

Personal Finance Tracking

  • Monitor daily expenses
  • Track income sources
  • Analyze spending patterns

Budgeting

  • Set category budgets
  • Compare actual vs planned spending
  • Identify cost-saving opportunities

Tax Preparation

  • Export transaction history
  • Categorize deductible expenses
  • Generate annual summaries

๐Ÿ› Troubleshooting

Database Issues

# Reset database
rm finance.db
python db_setup.py

Import Errors

# Reinstall dependencies
pip install --upgrade pandas matplotlib

CSV Export Problems

  • Check file permissions
  • Ensure output directory exists
  • Verify data format

๐Ÿš€ Future Enhancements

  • ๐ŸŒ Web Interface - Browser-based UI with Flask/Django
  • ๐Ÿ“ฑ Mobile App - Cross-platform mobile application
  • ๐Ÿ”„ Recurring Transactions - Auto-add monthly bills
  • ๐Ÿฆ Bank Integration - Import transactions from banks
  • ๐Ÿ“Š Advanced Analytics - Budgeting goals and forecasting
  • ๐Ÿ”” Notifications - Alerts for budget limits
  • ๐ŸŒ Multi-currency - Support for multiple currencies

๐Ÿค Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“œ License

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


๐Ÿ”— Links


๐Ÿ“ง Contact

Dheeraj Pilli


โญ Star this repo if you find it helpful!

Built with โค๏ธ using Python, SQLite, and Pandas

About

Personal Financer is a Python-based tool to track income, expenses, and savings. Manage transactions, categorize spending, generate summaries, and export data to CSV for easy financial analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages