Skip to content

imranalimemon/school_management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🏫 School Management System

Python OOP License

A console-based school management system built in Python demonstrating core OOP principles.
Manage students, courses, enrollment, and GPA calculations with file-based persistence.


📋 Table of Contents


🧱 OOP Concepts Demonstrated

Concept Where It's Used
Encapsulation Private attributes with @property getters/setters in Student, Course
Inheritance GradStudent extends Student with thesis and advisor fields
Polymorphism get_info() method behaves differently for Student vs GradStudent
Abstraction FileManager hides CSV file handling details behind simple methods
Composition Course manages a list of enrolled student IDs

✨ Features

  • ✅ Add, search, and display students
  • ✅ Create courses with capacity limits
  • ✅ Enroll/drop students from courses
  • ✅ GPA tracking and validation (0.0–4.0 scale)
  • ✅ Graduate student support (thesis topic, advisor)
  • ✅ File persistence — save/load data to CSV files
  • ✅ Input validation and error handling

📁 Project Structure

school_management/
├── src/
│   ├── student.py        # Student (base) + GradStudent (derived) classes
│   ├── course.py         # Course class with enrollment management
│   ├── file_manager.py   # File I/O for data persistence
│   └── main.py           # CLI demo — runs all features
├── data/
│   └── students.txt      # Sample data file
└── README.md

🚀 How to Run

# Clone the repository
git clone https://github.com/imranalimemon/school_management.git
cd school_management

# Run the demo
python src/main.py

No external dependencies needed — uses only Python standard library.


📺 Example Output

============================================================
  SCHOOL MANAGEMENT SYSTEM
  Object-Oriented Programming Demo
============================================================

--- Creating sample data ---

================================================================================
  ALL STUDENTS
================================================================================
  1. ID: STU-1001 | Name: Ali Ahmed | Age: 20 | Grade: BS-CS Year 3 | GPA: 3.45
  2. ID: STU-1002 | Name: Fatima Noor | Age: 19 | Grade: BS-CS Year 2 | GPA: 3.72
  3. ID: STU-1003 | Name: Hassan Raza | Age: 21 | Grade: BS-CS Year 4 | GPA: 2.98
  4. [GradStudent] ID: STU-1004 | Sara Khan | Thesis: PPE Detection using YOLOv8
  5. [GradStudent] ID: STU-1005 | Usman Tariq | Thesis: NLP for Urdu Text

  GPA SUMMARY
  Highest GPA: 3.85  |  Lowest GPA: 2.98  |  Average GPA: 3.52

📐 Class Diagram

┌─────────────────────────┐
│       Student           │
├─────────────────────────┤
│ - student_id: str       │
│ - name: str             │
│ - age: int              │
│ - grade: str            │
│ - _gpa: float           │
│ - _courses: list        │
├─────────────────────────┤
│ + enroll_course()       │
│ + drop_course()         │
│ + get_info()            │
│ + to_dict() / from_dict │
└────────┬────────────────┘
         │ inherits
         ▼
┌─────────────────────────┐
│     GradStudent         │
├─────────────────────────┤
│ - thesis_topic: str     │
│ - advisor: str          │
├─────────────────────────┤
│ + get_info() (override) │
└─────────────────────────┘

┌─────────────────────────┐     ┌─────────────────────────┐
│       Course            │     │     FileManager         │
├─────────────────────────┤     ├─────────────────────────┤
│ - course_id: str        │     │ - data_dir: str         │
│ - name: str             │     ├─────────────────────────┤
│ - instructor: str       │     │ + save_students()       │
│ - capacity: int         │     │ + load_students()       │
│ - enrolled_students     │     │ + save_courses()        │
├─────────────────────────┤     │ + load_courses()        │
│ + enroll_student()      │     └─────────────────────────┘
│ + remove_student()      │
└─────────────────────────┘

💡 Key Learnings

  1. Encapsulation protects data integrity — GPA validation ensures values stay within 0.0–4.0 range
  2. Inheritance reduces code duplication — GradStudent reuses all Student logic and adds thesis info
  3. Polymorphism enables flexible code — same get_info() call works differently based on object type
  4. File I/O adds real-world value — data persists between program runs using CSV format
  5. Properties vs direct access — Python's @property decorator gives Java-style getters/setters with cleaner syntax

📄 License

MIT License


Built by Imran Ali — MUET Jamshoro, CS 2026

About

Object-oriented school management system in Python - demonstrating encapsulation, inheritance, polymorphism, and file I/O

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages