0% found this document useful (0 votes)
25 views15 pages

Simple Banking System in Python

Uploaded by

shuklarohan388
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views15 pages

Simple Banking System in Python

Uploaded by

shuklarohan388
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Shree Shankar Narayan Education Trust's

PRAVIN ROHIDAS PATIL COLLEGE OF


ENGINEERING & TECHNOLOGY
Affiliated to the University of Mumbai
Recognized by D.T.E. Govt. of Maharashtra | Approved by A.I.C.T.E. New Delhi

SIMPLE BANKING SYSYTEM


Submitted in partial fulfillment of the requirements
Of the Mini-Project Second Year of
Bachelors of Engineering

SAWANT ATHARVA (Roll no 57)


DUBEY BHUMI MANOJKUMAR (Roll no 58)
AMAAN BASHIR SHAIKH (Roll no 59)
SAWANT ARPITA DEVENDRA (Roll no 60)

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

__________________ __________________
[Link] 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 [Link] 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.

0. Aim of the Micro-Project

1. To develop a simple and user-friendly banking system using Python.


2. To simulate core banking functionalities like account creation, deposit, withdrawal, and balance check.
3. To apply Object-Oriented Programming (OOP) concepts such as classes, objects, and methods.
4. To demonstrate input handling and control flow in a real-world sce
PROBLEM STATEMENT
The project titled Simple Banking System is database management software for monitoring
and controlling the system in Banks. The project “Simple Banking System” is developed in
[Link] 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. While real-world banking applications
are complex and involve large-scale systems with databases, encryption, and network security,
there is a need for a simplified model that captures the core functionalities to help beginners
understand how such systems [Link] project aims to address the lack of basic, educational
banking simulations by building a simple, console-based banking system in Python. The
problem arises from the need to provide a practical, hands-on [Link], many
beginners in programming lack practical exposure to real-life systems like banking
applications. There is a need for a simple, console-based banking system that simulates
essential banking operations and helps users understand how such systems function.

The challenge is to design and implement a basic banking system using Python that allows
users to:

• Create and manage bank accounts


• Deposit and withdraw funds securely
• Check account balances
• Store and process account information in an organized way

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 [Link] 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

• Create and manage bank accounts


• Deposit and withdraw funds securely
• Check account balances
• Store and process account information in an organized way

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. [Link]:
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 Connection Setup


def connect():
try:
# Connect to SQLite (it will create a file if it doesn't exist)
conn = [Link]("[Link]")
print("Connection to SQLite was successful!")
return conn
except Error as e:
print(f"Error: {e}")
return None
# Initialize the database and table if not already created
def initialize_database():
conn = connect()
if conn:
cursor = [Link]()
try:
# Create the accounts table if it doesn't exist
[Link]("""
CREATE TABLE IF NOT EXISTS accounts (
acc_id TEXT PRIMARY KEY,
name TEXT,
balance REAL DEFAULT 0.0
)
""")
[Link]()
print("Database and table initialized.")
except Error as e:
print(f"Error: {e}")
finally:
[Link]()

# Database operations
def create_account(name, balance):
conn = connect()
if conn:
cursor = [Link]()
try:
# Generate a random Account ID (4 to 5 characters)
acc_id = ''.join([Link](string.ascii_uppercase + [Link], k=5))
print(f"Generated Account ID: {acc_id}") # Debugging log

# Insert the account into the database


[Link]("INSERT INTO accounts (acc_id, name, balance) VALUES (?, ?, ?)",
(acc_id, name, balance))
[Link]()

print("Account created successfully.") # Debugging log


return acc_id # Return the generated Account ID

except Error as e:
print(f"Database error: {e}") # Detailed error message
return None
finally:
[Link]()

def check_balance(acc_id):
conn = connect()
if conn:
cursor = [Link]()
try:
[Link]("SELECT balance FROM accounts WHERE acc_id = ?", (acc_id,))
result = [Link]()
if result:
return result[0] # Return the balance
else:
return None # Account not found
except Error as e:
print(f"Error: {e}")
finally:
[Link]()
else:
return None

def deposit_money(acc_id, amount):


conn = connect()
if conn:
cursor = [Link]()
try:
[Link]("UPDATE accounts SET balance = balance + ? WHERE acc_id = ?",
(amount, acc_id))
[Link]()
print(f"Deposited {amount} to account {acc_id}.")
except Error as e:
print(f"Error: {e}")
finally:
[Link]()

def withdraw_money(acc_id, amount):


conn = connect()
if conn:
cursor = [Link]()
try:
[Link]("UPDATE accounts SET balance = balance - ? WHERE acc_id = ?",
(amount, acc_id))
[Link]()
print(f"Withdrew {amount} from account {acc_id}.")
except Error as e:
print(f"Error: {e}")
finally:
[Link]()

def close_account(acc_id):
conn = connect()
if conn:
cursor = [Link]()
try:
[Link]("DELETE FROM accounts WHERE acc_id = ?", (acc_id,))
[Link]()
print(f"Account {acc_id} closed successfully!")
except Error as e:
print(f"Error: {e}")
finally:
[Link]()

2. [Link]:
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:
[Link]("Input Error", "Name cannot be empty!")
return False
return True
def validate_balance(balance):
try:
balance = float(balance)
if balance < 0:
[Link]("Input Error", "Balance cannot be negative!")
return False
return True
except ValueError:
[Link]("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:
[Link]("Input Error", "Account number must be a valid 4-5
character alphanumeric ID!")
return False
return True

3. [Link]:
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([Link]):
def __init__(self):
super().__init__()
[Link]("Banking System")
[Link]("600x500")
[Link](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 = [Link](self, bg="#3498db", bd=5)
create_account_frame.pack(fill="x", padx=20, pady=10)

[Link](create_account_frame, text="Create Account", font=("Helvetica", 18, "bold"),


fg="white", bg="#3498db").pack(pady=10)

self.name_var = [Link]()
self.balance_var = [Link]()

[Link](create_account_frame, text="Name", font=("Helvetica", 12), fg="white",


bg="#3498db").pack()
[Link](create_account_frame, textvariable=self.name_var, font=("Helvetica",
12)).pack(pady=5)

[Link](create_account_frame, text="Initial Balance", font=("Helvetica", 12),


fg="white", bg="#3498db").pack()
[Link](create_account_frame, textvariable=self.balance_var, font=("Helvetica",
12)).pack(pady=5)

[Link](create_account_frame, text="Create Account", font=("Helvetica", 12),


bg="#2ecc71", fg="white", command=self.create_account).pack(pady=10)
# Account operations section (with off-white background for clarity)
operations_frame = [Link](self, bg="#ffffff", bd=5)
operations_frame.pack(fill="x", padx=20, pady=10)

[Link](operations_frame, text="Account Operations", font=("Helvetica", 18, "bold"),


fg="#2c3e50", bg="#ffffff").pack(pady=10)
self.acc_number_var = [Link]()
[Link](operations_frame, text="Account ID", font=("Helvetica", 12), fg="#2c3e50",
bg="#ffffff").pack()
[Link](operations_frame, textvariable=self.acc_number_var, font=("Helvetica",
12)).pack(pady=5)
[Link](operations_frame, text="Check Balance", font=("Helvetica", 12),
bg="#9b59b6", fg="white", command=self.check_balance).pack(pady=5)
[Link](operations_frame, text="Deposit", font=("Helvetica", 12), bg="#1abc9c",
fg="white", command=self.deposit_money).pack(pady=5)
[Link](operations_frame, text="Withdraw", font=("Helvetica", 12), bg="#e74c3c",
fg="white", command=self.withdraw_money).pack(pady=5)
[Link](operations_frame, text="Close Account", font=("Helvetica", 12),
bg="#f39c12", fg="white", command=self.close_account).pack(pady=5)

def create_account(self):
name = self.name_var.get()
balance = self.balance_var.get()

if validate_name(name) and validate_balance(balance):


acc_id = create_account(name, balance)
if acc_id:
[Link]("Success", f"Account Created Successfully! Your Account ID:
{acc_id}")
else:
[Link]("Failed", "Failed to create account. Please try again.")

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:
[Link]("Balance", f"Current Balance: {balance}")
else:
[Link]("Not Found", "Account not found!")

def deposit_money(self):
acc_id = self.acc_number_var.get()

if validate_account_number(acc_id):
amount = [Link]("Deposit", "Enter amount to deposit:")
if amount and amount > 0:
deposit_money(acc_id, amount)
[Link]("Success", "Money Deposited Successfully!")
else:
[Link]("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 = [Link]("Withdraw", "Enter amount to withdraw:")
if amount and amount > 0:
withdraw_money(acc_id, amount)
[Link]("Success", "Money Withdrawn Successfully!")
else:
[Link]("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 = [Link]("Confirmation", "Are you sure you want to close this
account?")
if result:
close_account(acc_id)
[Link]("Success", "Account Closed Successfully!")
else:
[Link]("Cancelled", "Account Closure Cancelled!")

if __name__ == "__main__":
app = BankingSystem()
[Link]()
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.

AND IF WANT TO CLOSE THE ACCOUNT YOU COULD CLOSE IT.

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.

Common questions

Powered by AI

The Simple Banking System addresses the problem of lack of practical exposure to real-world banking applications for beginners. It serves as an educational tool by providing a simplified model that simulates essential banking operations, allowing novice programmers to understand core functionalities. This project allows hands-on learning in a controlled environment, demonstrating the principles of OOP, input handling, and control flow in Python . By avoiding complex features and focusing on fundamental banking tasks, it helps beginners grasp the underlying operation of such systems .

The Simple Banking System uses OOP principles by implementing a BankAccount class, which encapsulates account details and provides methods for operations like deposits and withdrawals. This approach ensures data integrity and allows secure, efficient transaction handling . The system handles multiple accounts by storing data in a structured manner, using classes, methods, and attributes to maintain and process account information, demonstrating key concepts of encapsulation and abstraction in OOP .

The key functionalities of the Simple Banking System include creating and managing bank accounts, depositing and withdrawing funds securely, checking account balances, and storing account information in an organized manner. These functions are essential for mimicking real-world banking applications, serving as a foundation for beginner programmers to understand the core operations of banking systems .

User input validation in the Simple Banking System ensures the reliability and integrity of data entered by users. This is achieved by validating account numbers, names, and balances before processing operations. For instance, input validation prevents negative balances by ensuring that deposits and withdrawals are only processed if the amounts are valid. It also checks that account IDs are alphanumeric and of proper length. Such validations safeguard against erroneous data entries and maintain the consistency of the banking system's operations .

Expanding the Simple Banking System to include real-world functionalities such as encryption and network security presents several challenges. Implementing encryption would require secure algorithms and methods to protect data both in storage and during transmission, adding complexity to the system. Network security involves securing data exchange over potentially insecure channels and may require sophisticated protocols and infrastructure. Both aspects demand advanced knowledge in cybersecurity and can significantly increase development time and resource requirements. Additionally, ensuring compliance with financial regulations and standards could introduce further complexities .

The introduction of a GUI using Tkinter enhances the usability of the Simple Banking System by providing a more intuitive and user-friendly interface. This visual interface allows users to interact with the system more naturally through buttons and text fields, rather than typing commands in a console. It simplifies the execution of banking operations like account creation, deposits, withdrawals, and balance inquiries, thereby improving the overall user experience and making the system accessible to a broader audience .

The Simple Banking System lays the groundwork for future expansions by providing a clear, modular framework that emphasizes core functionalities. Future expansions could integrate more complex features such as database integration, encryption, and web interfaces. The current implementation's use of OOP principles allows for scalability, where more sophisticated banking operations and security measures could be layered on top of the existing system. While the current focus is on simplicity and educational value, the project's structure allows for easy enhancement and adaptation to real-world complexities as developers' skills advance .

The database plays a crucial role in maintaining the system's integrity and functionality by acting as a centralized storage point for all account-related data. It ensures that the data is consistently updated and retrieved accurately, supporting operations like account creation, balance checks, deposits, and withdrawals. The use of a SQLite database allows for structured storage, preventing data inconsistency and loss. By handling data operations at the database level, the system maintains reliability and durability, crucial for ensuring that banking processes run smoothly and accurately .

The project ensures secure deposit and withdrawal transactions through several mechanisms. Firstly, it employs input validation to confirm that transaction amounts are valid, preventing negative balances and overdrafts. Additionally, the use of structured data storage, such as a SQLite database, helps maintain accurate records of transactions, reducing the risk of data loss or corruption. Moreover, the encapsulation provided by the BankAccount class ensures that account details and operations are managed within a secure, isolated context, protecting data integrity during transactions .

Using a console-based menu for user interactions in the Simple Banking System provides simplicity and clarity, particularly beneficial for beginners. It offers a straightforward way to execute basic banking operations without the overhead of a graphical interface. A text-based menu is easy to implement and understand, allowing users to focus on the underlying programming concepts rather than interface design. This choice reflects the educational goal of the project, enabling users to practice and learn essential programming skills in a clear, controlled environment .

You might also like