Skip to content

About

A beginner-friendly Python Student Management System using JSON file handling, functions, CRUD operations, and exception handling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🎓 Student Management System (Python)

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.


📋 Project Description

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.


✨ Features

  • ➕ 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-except without crashing

🛠️ Technologies Used

  • Language: Python 3
  • Modules: json, os (both built into Python — no installation needed)
  • Concepts: Functions, Lists, Dictionaries, Loops, Conditionals, Exception Handling, File Handling

📁 Folder Structure

Student-Management-System/
│── student_management.py   # Main program
│── students.json            # Student data (auto-created/updated)
│── README.md                 # Project documentation

⚙️ Installation

  1. Make sure Python 3 is installed:
    python --version
    
  2. Clone or download this repository.
  3. No extra packages are required — the project only uses Python's built-in json and os modules.

🚀 How to Run

  1. Open a terminal in the project folder:
    cd Student-Management-System
    
  2. Run the program:
    python student_management.py
    
  3. Use the on-screen menu to manage student records.

students.json is created automatically the first time you run the program if it doesn't already exist.


💡 Sample Output

==================================
 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!

📚 Learning Outcomes

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

🔮 Future Improvements

  • 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

👤 Author

Farhan Khizar


📄 License

This project is open-source and available for learning purposes under the MIT License.

About

A beginner-friendly Python Student Management System using JSON file handling, functions, CRUD operations, and exception handling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages