Skip to content

AdiyaTakhell/FinTrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Python CLI Finance Tracker

A simple yet powerful command-line interface (CLI) finance tracker built with Python. This application allows you to easily log your income and expenses, monitor your financial balance, and generate insightful summaries of your spending and earnings. All your financial data is persistently stored in a .csv file, ensuring your records are safe and accessible.

✨ Features

  • Interactive Command-Line Interface: User-friendly menu-driven system for easy navigation and transaction management.
  • Record Transactions: Log both income and expense transactions with details such as amount, category, and optional notes.
  • Real-time Balance Tracking: Automatically calculates and updates your current financial balance with every transaction.
  • Data Persistence: All your financial records are securely saved to a finance_log.csv file, ensuring your data is available across different sessions.
  • Comprehensive Financial Summaries:
    • View your total income, total expenses, and overall current balance.
    • Generate detailed summaries of your income and expenses, broken down by category, for better financial insight.
  • Robust Input Validation: Includes validation for numerical amounts and ensures categories are properly formatted, enhancing data integrity and preventing common input errors.

🚀 Getting Started

Prerequisites

  • Python 3.x: This project utilizes standard Python libraries, so no external dependencies need to be installed via pip.

Installation

  1. Save the Files:

    • Save the FinanceTracker class code into a file named finance_tracker.py.
    • Save the CLI code (the second file you provided) into a file named main.py.

    Your project directory should look like this:

    .
    ├── finance_tracker.py
    └── main.py
    
  2. Run the Application: Navigate to the project directory in your terminal and run the main.py file:

    python main.py

    The application will launch, presenting you with the main menu. The finance_log.csv file will be automatically created in the same directory (or a specified folder, though the CLI uses the current directory) when you first run the application or record a transaction.

💡 Usage

Once you run main.py, you'll see an interactive menu. Follow the prompts to add transactions, view summaries, or exit.

--- 📘 Finance Tracker Menu ---
1. Add Income
2. Deduct Expense
3. View Total Income
4. View Total Expense
5. View Current Balance Summary
6. View Summary by Category
7. Exit
Enter your choice (1-7):

Examples of Interaction:

  • Add Income: Choose 1, enter amount, category (e.g., "Salary", "Freelance"), and notes.
  • Deduct Expense: Choose 2, enter amount, category (e.g., "Groceries", "Rent"), and notes.
  • View Summary by Category: Choose 6, then specify "Income" or "Expense" to filter, or just press Enter to see all categorized transactions.

📂 Project Structure

.
├── finance_tracker.py    # Core logic for managing finances and CSV operations
├── main.py               # Command-line interface to interact with FinanceTracker
└── finance_log.csv       # (Automatically generated) Stores all transaction data

🛠️ Development Details

Precision

The decimal module is used for precise financial calculations, set globally to a precision of 10 decimal places to prevent floating-point inaccuracies.

Error Handling

The application includes robust error handling for user inputs, catching ValueError for invalid amounts or categories. It also gracefully handles malformed rows in the CSV file by skipping them and issuing a warning, ensuring data integrity.

🤝 Contributing

Contributions are always welcome! If you have suggestions for improvements, bug reports, or want to add new features, please feel free to:

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

📄 License

This project is open-source and available under the MIT License.


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages