This is a reupload of a menu-driven Python application for managing bank accounts created by Om, transactions, loans, and administrative tasks. It supports user authentication, audit logging, automated backups, and more.
- User operations: Register, login/logout, check balance, deposit, withdraw, transfer funds, view statements, update details, close account.
- Loan management: Apply for loans, view existing loans, make loan payments.
- Administrative operations: Admin login/logout, freeze/unfreeze accounts, view audit logs.
- Audit logging: All critical actions are logged to
audit.logwith timestamps. - Automated backups: Periodic backups of CSV data files to
backups/directory. - Data persistence: Account, transaction, and loan data stored in CSV files.
- Python 3.8 or higher
schedule(for automated backups)
-
Clone or download this repository into your local machine.
-
Create a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install schedule
-
Prepare data files:
- Ensure the following files exist in the project root (they will be created automatically on first run if missing):
accounts.csvtransactions.csvloans.csvadmins.jsonaudit.log
You can also initialize
admins.jsonwith an empty JSON object:{} - Ensure the following files exist in the project root (they will be created automatically on first run if missing):
-
(Optional) Create an admin user:
Edit
admins.jsonand add an entry with a username and a SHA256-hashed password. Example:{ "superadmin": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd..." }To generate a SHA256 hash for your desired password in Python:
import hashlib print(hashlib.sha256(b"your_password_here").hexdigest())
With your virtual environment activated, simply run:
python bank_management_full.pyYou will see a menu with options for both user and admin operations.
├── main.py # Main application script
├── accounts.csv # Stores account details
├── transactions.csv # Stores transaction logs
├── loans.csv # Stores loan records
├── admins.json # Admin credentials (username: password_hash)
├── audit.log # Audit log of all actions
└── backups/ # Directory where automated backups are saved
- Data security: Passwords are stored as SHA256 hashes. For production use, consider using a stronger hashing algorithm like bcrypt.
- Backup interval: The default backup interval is every 60 minutes. Modify
BACKUP_INTERVAL_MINUTESinbank_management_full.pyas needed. - Extensibility: You can replace CSV storage with a database, integrate email/SMS notifications, or build a web API on top of this core logic.