ATM Simulation System
A working cash machine in Python and MySQL — balance, withdrawal, deposit and a transaction history.
- Python
- MySQL
- mysql-connector
About this project
A menu-driven cash machine: check a balance, withdraw, deposit, change a PIN, and print a mini statement. Every action writes to a transaction table, so the balance is always explainable rather than just a number that changed.
The reason this is a better first database project than it looks is that money is unforgiving. A withdrawal has to debit the account AND write the transaction, and if the program dies between the two the account is wrong forever. So the withdrawal runs in a transaction and commits once. That single idea — that some operations must happen completely or not at all — is the thing worth taking away.
What you will learn
- Connect a Python program to MySQL and run queries safely with parameters
- Model money correctly — why a balance is never stored as a floating-point number
- Write a withdrawal so a crash halfway through cannot lose or duplicate money
- Keep an append-only transaction log and reconcile a balance from it
- Lock an account after repeated wrong PINs, and hash the PIN rather than storing it
Before you start
- Python basics — variables, loops, functions
- A little SQL: SELECT, INSERT, UPDATE
- MySQL installed locally, or access to any MySQL server
New to Python? The free Python course covers everything this project assumes.
Academic integrity notice
These projects are provided for learning, experimentation and reference. Understand the code, modify it for your own requirements, and acknowledge external work according to your institution’s academic policies. Priodemy does not supply work to be submitted as your own.
Features
- PIN login, with the PIN stored as a salted hash rather than plain text
- Balance enquiry, withdrawal, deposit and PIN change
- Every action recorded in an append-only transaction table
- Mini statement of recent transactions
- Withdrawals run inside a database transaction — all of it, or none of it
- Account locks after three wrong PIN attempts
- Balances stored in paise as integers, never as floats
- Parameterised queries throughout
Technology stack
Track: Python & AI/ML · Level: Mini project
What is included
- Full Python source, commented
- MySQL schema (.sql) with sample accounts
- Setup and installation guide
- A short note on why the schema looks the way it does
- Sample output for every menu option
Delivered as a 12 KB ZIP. SHA-256 published under Changelog so you can verify it.
System requirements
- Operating system
- Windows, macOS or Linux
- Runtime
- Python 3.10 or newer
- Database
- MySQL 8.0 or newer
Licence
Learn from it, change it, and use it in your own coursework and personal projects. Do not resell it or pass it off as your own original work.
- Personal and educational use
- Modifying the code however you like
- Using it as the basis of your own coursework, with honest acknowledgement
- Putting your modified version in a portfolio or on your own GitHub
- Reselling or redistributing the project, modified or not
- Presenting it as your own original work
- Commercial deployment — see the Commercial licence
Support window: 6 months from download.
Frequently asked
Is this suitable for a Class 12 or BCA project?
It is the standard shape both expect — Python talking to MySQL through mysql-connector, menu driven, with a report. Treat it as a reference implementation: read it, change the schema to your own requirements, and write your own documentation.
Why are balances stored in paise instead of rupees?
Because 0.1 + 0.2 does not equal 0.3 in floating-point arithmetic, and money that is a fraction of a paisa out is money that is wrong. Storing whole paise as an integer removes the problem entirely. The guide explains it with a worked example.
Can I use SQLite instead of MySQL?
Yes, with small changes. The database code sits in its own module precisely so the connection and queries can be swapped without touching the menu. The setup guide covers what changes.
It says "Access denied for user" when I run it.
That is MySQL rejecting the credentials in the config file, not a fault in the project. The usual cause is a root password set during installation and never copied into the config. The setup guide has a section on it.
Changelog
- First release
SHA-256532ef8e7a70b8efee22f7ae6f389dfda8f5a9ec61288169312d0fb5f2942077d