A console-based school management system built in Python demonstrating core OOP principles.
Manage students, courses, enrollment, and GPA calculations with file-based persistence.
- OOP Concepts Demonstrated
- Features
- Project Structure
- How to Run
- Example Output
- Class Diagram
- Key Learnings
| 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 |
- ✅ 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
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
# Clone the repository
git clone https://github.com/imranalimemon/school_management.git
cd school_management
# Run the demo
python src/main.pyNo external dependencies needed — uses only Python standard library.
============================================================
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
┌─────────────────────────┐
│ 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() │
└─────────────────────────┘
- Encapsulation protects data integrity — GPA validation ensures values stay within 0.0–4.0 range
- Inheritance reduces code duplication — GradStudent reuses all Student logic and adds thesis info
- Polymorphism enables flexible code — same
get_info()call works differently based on object type - File I/O adds real-world value — data persists between program runs using CSV format
- Properties vs direct access — Python's
@propertydecorator gives Java-style getters/setters with cleaner syntax
MIT License
Built by Imran Ali — MUET Jamshoro, CS 2026