Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Student Management System

A beginner-friendly Python CLI application for managing student records using JSON file storage.

Features

  • View all students
  • Add new students
  • Search students by name
  • Delete students
  • Persistent data storage using JSON
  • Handles missing JSON files
  • Input validation using try/except
  • Case-insensitive student search

Concepts Learned

  • Python functions
  • Lists
  • Dictionaries
  • Loops
  • Conditional statements
  • Function arguments
  • File handling
  • JSON
  • json.load()
  • json.dump()
  • try/except
  • FileNotFoundError
  • ValueError
  • List append()
  • List remove()
  • Dictionary .get()
  • String .lower()

How It Works

The application loads student data from students.json when it starts.

When a student is added or deleted, the updated student list is saved back to the JSON file.

students.json
     ↓
json.load()
     ↓
Python list
     ↓
Add / View / Search / Delete
     ↓
json.dump()
     ↓
students.json

Menu

1. View Students
2. Add Student
3. Search Student
4. Delete Student
5. Exit

Data Structure

Each student is stored as a dictionary inside a list.

Example:

students = [
    {
        "name": "Muhammad Ahsan",
        "age": 21,
        "university": "COMSATS University Islamabad",
        "department": "Computer Engineering",
        "semester": 5,
        "favorite_language": "Python",
        "dream_company": "Phoenix AI"
    }
]

The complete list is stored permanently in a JSON file.

Error Handling

The application uses try/except to handle invalid numerical input.

If the user enters text instead of a number for age or semester, the program does not crash. It asks the user to enter a valid number.

The application also handles a missing students.json file by starting with an empty student list.

Requirements

  • Python 3.x
  • No external libraries required

How to Run

python main.py

The program will use students.json for persistent student data.

CRUD Operations

This project introduces the basic CRUD concept:

  • Create → Add Student
  • Read → View and Search Students
  • Update → Not implemented in this version
  • Delete → Delete Student

Project Learning Progression

Python Fundamentals
        ↓
Lists & Dictionaries
        ↓
Functions
        ↓
File Handling
        ↓
JSON
        ↓
Persistent Data
        ↓
CRUD Operations
        ↓
Error Handling

Project Goal

The goal of this project was to learn how Python applications can manage structured data and store that data permanently using JSON.

This project moves beyond simple terminal programs and introduces the foundations of real data-driven applications.

Author

Muhammad Ahsan

Computer Engineering Student
COMSATS University Islamabad, Lahore Campus

About

A Python CLI Student Management System with JSON data storage, CRUD operations, search, delete, and input validation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages