Python Project
Python Project
Guided By:
Prof. Manjula Athani
Department of Computer Engineering
University of Mumbai
Academic year (2024-2025)
CERTIFICATE
This is to certify that the mini-project entitled “SIMPLE BANKING SYSTEM” is a bonafide
work of
SAWANT ATHARVA (Roll no 57)
DUBEY BHUMI MANOJKUMAR (Roll no 58)
AMAAN BASHIR SHAIKH (Roll no 59)
SAWANT ARPITA DEVENDRA (Roll no 60)
Submitted to the University of Mumbai in partial fulfillment of the requirement for the Mini-
Project Second Year of the Bachelor of Engineering in
“Computer Engineering”.
_______________________
Prof. Manjula Athani
Guide
__________________ __________________
Prof.Manjula Athani Principal
HOD Devichand Rathod
ABSTRACT
1. Brief Introduction
This project presents a Simple Banking System implemented using the Python programming language. The
primary objective is to simulate basic banking operations in a console-based environment, allowing users to
perform functions such as creating accounts, viewing balances, depositing funds, and withdrawing money.
The system uses Object-Oriented Programming (OOP) principles to manage customer data and transactions
securely and efficiently.The core component of the system is the BankAccount class, which encapsulates
account details and provides methods for deposit and withdrawal while ensuring data integrity. A simple
menu-driven interface enables users to interact with the system in a user-friendly manner. While the project
avoids complex features like databases or web integration, it lays the groundwork for future expansion into
more robust banking applications.
This simple system serves as an educational tool for beginners in programming, demonstrating essential OOP
concepts, input handling, and program control flow in Python.
The challenge is to design and implement a basic banking system using Python that allows
users to:
This system should demonstrate the principles of Object-Oriented Programming, user input
handling, and control structures while maintaining simplicity and clarity. It should be easy to
use, maintain, and serve as a learning tool for aspiring developers.
WORKING
1. Introduction
The project “Simple Banking System” is developed in python.In the modern world, managing
financial transactions efficiently is crucial for both individuals and institutions. Banking is an
essential part of everyday life, with millions of users depending on banking systems to
manage their finances.
2. Objectives
3. System Overview
3.1 Features
User Interface (Console-based Menu)
• Simple text menu to interact with the system.
• Prompts for input (e.g., account creation, deposit amount).
BankAccount Class
• Contains attributes like account number, account holder name, and balance.
• Methods for deposit, withdrawal, balance inquiry, and account summary.
Account Management System
• Handles storage and retrieval of multiple accounts using a Python dictionary or list.
• Searches for accounts using unique account numbers.
Input Validation and Error Handling
• Ensures that inputs are valid (e.g., numeric values for money).
• Prevents overdrafts and negative balances.
Transaction Processing
• Updates account balances upon successful deposit or withdrawal.
• Displays appropriate messages for success or failure.
PROGRAM
SOURCE CODE:
1. database.py:
Handles all database operations, including creating accounts, checking balances, and
processing deposits, withdrawals, and account closures using SQLite.
import sqlite3
from sqlite3 import Error
import random
import string
# Database operations
def create_account(name, balance):
conn = connect()
if conn:
cursor = conn.cursor()
try:
# Generate a random Account ID (4 to 5 characters)
acc_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
print(f"Generated Account ID: {acc_id}") # Debugging log
except Error as e:
print(f"Database error: {e}") # Detailed error message
return None
finally:
conn.close()
def check_balance(acc_id):
conn = connect()
if conn:
cursor = conn.cursor()
try:
cursor.execute("SELECT balance FROM accounts WHERE acc_id = ?", (acc_id,))
result = cursor.fetchone()
if result:
return result[0] # Return the balance
else:
return None # Account not found
except Error as e:
print(f"Error: {e}")
finally:
conn.close()
else:
return None
def close_account(acc_id):
conn = connect()
if conn:
cursor = conn.cursor()
try:
cursor.execute("DELETE FROM accounts WHERE acc_id = ?", (acc_id,))
conn.commit()
print(f"Account {acc_id} closed successfully!")
except Error as e:
print(f"Error: {e}")
finally:
conn.close()
2. utils.py:
Contains helper functions for validating user inputs, such as account numbers, names, and
balances, ensuring data integrity across the system.
from tkinter import messagebox
def validate_name(name):
if not name:
messagebox.showwarning("Input Error", "Name cannot be empty!")
return False
return True
def validate_balance(balance):
try:
balance = float(balance)
if balance < 0:
messagebox.showwarning("Input Error", "Balance cannot be negative!")
return False
return True
except ValueError:
messagebox.showwarning("Input Error", "Please enter a valid balance!")
return False
def validate_account_number(acc_no):
if not acc_no.isalnum() or len(acc_no) < 4:
messagebox.showwarning("Input Error", "Account number must be a valid 4-5
character alphanumeric ID!")
return False
return True
3. app.py:
Implements the graphical user interface (GUI) using Tkinter, allowing users to interact with
the banking system for various operations like creating accounts and managing funds.
import tkinter as tk
from tkinter import messagebox, simpledialog
from database import initialize_database, create_account, check_balance, deposit_money,
withdraw_money, close_account
from utils import validate_name, validate_balance, validate_account_number
class BankingSystem(tk.Tk):
def __init__(self):
super().__init__()
self.title("Banking System")
self.geometry("600x500")
self.configure(bg="#f7f7f7") # Light gray background for the window
self.initialize_gui()
initialize_database() # Initialize the database when the app starts
def initialize_gui(self):
# Create account section (with soft royal blue background)
create_account_frame = tk.Frame(self, bg="#3498db", bd=5)
create_account_frame.pack(fill="x", padx=20, pady=10)
self.name_var = tk.StringVar()
self.balance_var = tk.StringVar()
def create_account(self):
name = self.name_var.get()
balance = self.balance_var.get()
def check_balance(self):
acc_id = self.acc_number_var.get()
if validate_account_number(acc_id):
balance = check_balance(acc_id)
if balance is not None:
messagebox.showinfo("Balance", f"Current Balance: {balance}")
else:
messagebox.showwarning("Not Found", "Account not found!")
def deposit_money(self):
acc_id = self.acc_number_var.get()
if validate_account_number(acc_id):
amount = simpledialog.askfloat("Deposit", "Enter amount to deposit:")
if amount and amount > 0:
deposit_money(acc_id, amount)
messagebox.showinfo("Success", "Money Deposited Successfully!")
else:
messagebox.showwarning("Input Error", "Please enter a valid amount!")
def withdraw_money(self):
acc_id = self.acc_number_var.get()
if validate_account_number(acc_id):
amount = simpledialog.askfloat("Withdraw", "Enter amount to withdraw:")
if amount and amount > 0:
withdraw_money(acc_id, amount)
messagebox.showinfo("Success", "Money Withdrawn Successfully!")
else:
messagebox.showwarning("Input Error", "Please enter a valid amount!")
def close_account(self):
acc_id = self.acc_number_var.get()
if validate_account_number(acc_id):
result = messagebox.askyesno("Confirmation", "Are you sure you want to close this
account?")
if result:
close_account(acc_id)
messagebox.showinfo("Success", "Account Closed Successfully!")
else:
messagebox.showinfo("Cancelled", "Account Closure Cancelled!")
if __name__ == "__main__":
app = BankingSystem()
app.mainloop()
OUTPUT:
IF YOU WANT TO DEPOSIT A CERTAIN AMOUNT
IF WANT TO WITHDRAW A CERAIN AMOUNT
AFTER EVERY TRANSACTION WHETHER IT BE DEPOSIT OR WITHDRAW IT WOULD UPADTE THE DATA
AND WHEN YOU CHECK THE BALANCE IN IT WOULD SHOW THE CURRENT BALANCE.
CONCLUSION:
The Simple Banking System in Python successfully demonstrates the implementation of
basic banking functionalities using core programming concepts. By leveraging Object-
Oriented Programming (OOP) principles, the system efficiently handles account
management, transactions, and user interactions through a straightforward console interface.