Skip to content

Latest commit

 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hospital Management System – OOP Project (Python + MySQL)

Python Database GUI CLI OOP Build Status

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.


Table of Contents

Overview

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

Features

  • 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

Tech Stack

  • Language: Python
  • GUI: Tkinter & CustomTkinter
  • Interface: CLI and GUI
  • Database: MySQL (hospital_db)
  • Design Pattern: Object-Oriented Programming

Project Structure

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

Setup Instructions

1. Clone the Repository

git clone https://github.com/alibro005/Hospital-Management-System.git
cd Hospital-Management-System

2. Create a Virtual Environment

For Windows:

python -m venv .venv
.venv\Scripts\activate

For macOS/Linux:

python -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install customtkinter mysql-connector-python

4. Set Up MySQL Database

Make 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.

5. Run the Application

To run the GUI version:

python login.py

To run the CLI version:

python main.py

Sample Credentials

  • Username: admin@hms.com
  • Password: 1234 (You can customize this in login.py)

Screenshots

Login Window

Login Window

Main Screen

Add Patient

Show Details

Add Patient

Class Diagram

The following diagram shows the relationships between core classes in the Hospital Management System for CLI version :

Class Diagram

Concepts Demonstrated

  • 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

Authors

References

  • 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.

License

This project is licensed under the MIT License see the LICENSE file for details.

About

A Python-based Hospital Management System with GUI using Tkinter and MySQL integration. Manages patients, doctors, billing, and user authentication through a modular OOP design.

Topics

Resources

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages