A simple, menu-driven Student Management System built with core Python. It lets you add, view, search, update, and delete student records, with all data automatically saved to a JSON file.
This project is built as a beginner-friendly, portfolio-ready application. It uses only functions, loops, dictionaries, and JSON file handling — no OOP, no databases, no APIs, and no external libraries.
The Student Management System is a command-line application that stores student records (Roll Number, Name, Age, Marks) in a JSON file called students.json. Every time the program starts, it automatically loads existing records, and every time you add, update, or delete a student, the changes are saved back to the file immediately.
The program is organized into small, focused functions, making the logic easy to follow, test, and explain.
- ➕ Add Student — with full input validation
- 📋 View Students — clean, aligned table format
- 🔍 Search Student — by roll number
- ✏️ Update Student — edit name, age, or marks (leave blank to keep current value)
- 🗑️ Delete Student — with confirmation prompt
- 🔢 Total Students — quick count of all records
- 💾 Automatic JSON file loading/saving on every change
- 🛡️ Handles missing, empty, or corrupted JSON files gracefully
- ✅ Validates unique roll numbers, non-empty names, age (3–100), and marks (0–100)
- 🚫 Handles invalid input using
try-exceptwithout crashing
- Language: Python 3
- Modules:
json,os(both built into Python — no installation needed) - Concepts: Functions, Lists, Dictionaries, Loops, Conditionals, Exception Handling, File Handling
Student-Management-System/
│── student_management.py # Main program
│── students.json # Student data (auto-created/updated)
│── README.md # Project documentation
- Make sure Python 3 is installed:
python --version - Clone or download this repository.
- No extra packages are required — the project only uses Python's built-in
jsonandosmodules.
- Open a terminal in the project folder:
cd Student-Management-System - Run the program:
python student_management.py - Use the on-screen menu to manage student records.
students.jsonis created automatically the first time you run the program if it doesn't already exist.
==================================
STUDENT MANAGEMENT SYSTEM
==================================
1. Add Student
2. View Students
3. Search Student
4. Update Student
5. Delete Student
6. Total Students
7. Exit
==================================
Enter your choice: 1
--- Add Student ---
Enter Roll Number: 1
Enter Name: Farhan Khizar
Enter Age: 21
Enter Marks: 88
Student 'Farhan Khizar' added successfully.
Enter your choice: 2
--- All Students ---
Roll No Name Age Marks
----------------------------------------------
1 Farhan Khizar 21 88.00
Enter your choice: 7
Exiting Student Management System. Goodbye!
Building this project helped reinforce the following concepts:
- Reading and writing data using JSON file handling
- Structuring a program around modular functions
- Using dictionaries and lists to model real-world records
- Writing solid input validation with
try-except - Handling edge cases like missing or corrupted files
- Building a clean, loop-based menu system
- Writing readable code that follows PEP 8 style
- Sort students by name, age, or marks
- Export student records to a CSV file
- Add a simple text-based report/summary view
- Search students by name
- Add grade calculation (A, B, C, D)
- Display average marks
- Display highest and lowest marks
Farhan Khizar
This project is open-source and available for learning purposes under the MIT License.