A Python-based Hospital Management System that combines Object-Oriented Programming, a Tkinter GUI, CLI options, and MySQL integration. It enables users to manage patient data, doctor assignments, billing, and user authentication through a clean, modular architecture.
- Overview
- Features
- Tech Stack
- Project Structure
- Setup Instructions
- Sample Credentials
- Screenshots
- Class Diagram
- Concepts Demonstrated
- Authors
- References
- License
This project is a desktop-based Hospital Management System built with Python.
It was developed to apply Object-Oriented Programming concepts to a practical application while also working with a relational database and graphical user interface.
The application provides both GUI and CLI versions and uses MySQL to store and manage hospital-related data.
The main operations include:
- User authentication
- Adding and deleting patients
- Adding doctors
- Assigning doctors to patients
- Viewing patient and doctor information
- Generating billing information
- Managing data through MySQL
- Login Authentication System
- Add / Delete Patients
- Add Doctors & Assign Them to Patients
- View Patient and Doctor Details
- Generate Billing Information
- GUI-based and CLI-based operation
- MySQL Database Integration
- Language: Python
- GUI: Tkinter & CustomTkinter
- Interface: CLI and GUI
- Database: MySQL (
hospital_db) - Design Pattern: Object-Oriented Programming
Hospital-Management/
├── main.py # CLI version
├── main_gui.py # GUI interface
├── login.py # Login window with GUI
├── database.py # MySQL DB connection
├── model/ # OOP-based entity classes
│ ├── person.py
│ ├── patient.py
│ ├── doctor.py
│ └── billing.py
└── .venv/ # Optional virtual environment
git clone https://github.com/alibro005/Hospital-Management-System.git
cd Hospital-Management-SystemFor Windows:
python -m venv .venv
.venv\Scripts\activateFor macOS/Linux:
python -m venv .venv
source .venv/bin/activatepip install customtkinter mysql-connector-pythonMake sure your MySQL server is running.
Open Database.txt and execute the SQL statements using a MySQL client such as MySQL Workbench, phpMyAdmin, or the MySQL command line.
This will create the hospital_db database and the required tables.
Before running the application, update the MySQL connection details in database.py according to your local MySQL configuration.
To run the GUI version:
python login.pyTo run the CLI version:
python main.py- Username: admin@hms.com
- Password: 1234 (You can customize this in login.py)
The following diagram shows the relationships between core classes in the Hospital Management System for CLI version :
- Object-Oriented Programming (Inheritance, Encapsulation, Composition)
- GUI development with Tkinter and CustomTkinter
- Integration of MySQL with Python using mysql-connector-python
- Functional separation between logic, database, and interface
- CLI and GUI support for managing hospital operations
- Tkinter used for building the graphical user interface in Python.
- MySQL used as the backend database system.
- Python MySQL Connector for integrating Python with MySQL.
- Object-Oriented Programming (OOP) concepts used to structure classes like Patient, Doctor, and Billing.
- Project developed as part of Object-Oriented Programming coursework at NCBA&E.
This project is licensed under the MIT License see the LICENSE file for details.



