The Finance Manager application is a simple tool to track and manage your finances. This app allows you to record your income and expenses, edit entries, delete records, and view your balance in real-time. The data is stored in an SQLite database, which ensures that your financial records persist even after you close the application.
- Add Transactions: Record income or expenses with a description and date.
- Edit Transactions: Modify existing records.
- Delete Transactions: Remove unwanted entries.
- Balance Display: View your balance, calculated as the total income minus expenses.
- Data Persistence: Financial records are stored in an SQLite database (
finance_manager.db). - Transaction History: View a detailed table of all transactions, sortable by date, amount, or type.
- Dynamic Updates: The balance and transaction list update automatically after each operation.
- Python 3.x
tkinter(for the graphical user interface)sqlite3(for database functionality)
These libraries are standard with Python, so you don't need to install anything extra.
- Select the transaction type (either
incomeorexpense) from the dropdown. - Enter the amount in the "Amount" field.
- Provide a description for the transaction (optional).
- Enter a date (optional; defaults to today's date).
- Click the "Add Transaction" button to save the entry.
- Click on a transaction in the transaction list (Treeview).
- Modify any of the fields (type, amount, description, date).
- Click the "Edit Transaction" button to save your changes.
- Select a transaction from the list.
- Click the "Delete Transaction" button.
- Confirm the deletion in the popup.
- The balance is calculated automatically by subtracting total expenses from total income.
- It is displayed at the top of the application window.
- All transactions are displayed in a table (Treeview) with the following columns:
- ID: A unique identifier for each transaction.
- Type: Whether the transaction is
incomeorexpense. - Amount: The amount of the transaction.
- Description: A brief description of the transaction (if provided).
- Date: The date when the transaction occurred.
The app uses SQLite to store the financial data in a database. A table called transactions is created with the following fields:
id: An auto-incrementing primary key.type: The transaction type (incomeorexpense).amount: The amount of money involved in the transaction.description: A description of the transaction.date: The date when the transaction occurred.
SQL queries are used to insert, update, delete, and select transactions.
- add_entry(): Adds a new transaction (income or expense) to the database. It validates the input and updates the balance and transaction list after adding the transaction.
- clear_entries(): Resets the input fields (transaction type, amount, description, date) to their default values.
- update_balance(): Calculates and updates the balance by fetching the total income and total expenses from the database.
- refresh_transactions(): Refreshes the Treeview widget to show the latest transactions from the database.
- load_selected_transaction(): Loads the selected transaction from the Treeview into the input fields for editing.
- edit_entry(): Edits an existing transaction based on the selected ID.
- delete_entry(): Deletes the selected transaction from the database after a confirmation prompt.
- Entry Fields: For entering transaction details (amount, description, date).
- Buttons: For adding, editing, and deleting transactions.
- Treeview: Displays all transactions in a table format, allowing users to select and edit them.
- Balance Label: Shows the current balance, which is updated automatically.
- The Treeview is used to display the transactions in a tabular format with columns for ID, Type, Amount, Description, and Date.
- You can select a row in the Treeview to edit or delete the corresponding transaction.
- Clone the repository or download the script.
- Ensure that Python 3.x is installed on your system.
- Run the script:
python finance_manager.pyThe app will automatically create a finance_manager.db database file if it does not already exist.
This project is open-source and available under the MIT License.
tkinterfor the graphical user interface.sqlite3for the database functionality.