INDEX
1. Introduction of the Project.
2. System Requirements of the Project.
3.Important Function
4. Python Coding.
5. Output of the Project.
6. BIBLIOGRAPHY
INTRODUCTION
The Hotel Management System is a Python-based software
application designed to streamline and automate the various
operations of a hotel. This project aims to provide an efficient
solution for managing bookings, room allocation, customer check-
ins and check-outs, billing, and other essential hotel services.
With the growing demand for digitalization in the hospitality
industry, this project offers a user-friendly interface combined with
robust functionality, ensuring seamless coordination between hotel
staff and guests. Built using Python, the system leverages its
versatile features to deliver a scalable and customizable solution
suitable for hotels of all sizes.
The project emphasizes:
• Simplifying the reservation process.
• Enhancing operational efficiency.
• Improving guest satisfaction through accurate and timely
service delivery.
By implementing this system, hotel managers can minimize manual
errors, save time, and focus on providing exceptional hospitality
services.
System Requirements of the Project
Recommended System Requirements
Processors: Intel® CoreTM i3 processor 4300M at 2.60 GHz. Disk space:
2 to 4 GB.
Operating systems: Windows® 10, MACOS, and UBUNTU. Python
Versions: 3.X.X or Higher.
Minimum System Requirements
Processors: Intel Atom® processor or Intel® CoreTM i3 processor. Disk
space: 1 GB.
Operating systems: Windows 7 or later, MACOS, and UBUNTU. Python
Versions: 2.7.X, 3.6.X.
Prerequisites before installing MySQL Connector Python
You need root or administrator privileges to perform the installation
process.
Python must be installed on your machine.
Note: – MySQL Connector Python requires python to be in the system’s
PATH. Installation fails if it doesn’t find Python.
On Windows, If Python doesn’t exist in the system’s PATH, please
manually add the directory containing python.exe yourself.
Project Modules:
1. MySQL Connector: For interacting with the MySQL database.
2. Custom modules: Any Python files (e.g., database.py, billing.py)
created to handle specific tasks in your system.
IMPORTANT FUNCTIONS:
1. Customer Management Functions:
a. add_customer_details(): Add new customer details to the database.
b. view_customer_details(): Retrieve and display customer details.
c. update_customer_details(): Modify existing customer records.
d. delete_customer_details(): Remove customer details if necessary.
2. Room Management Functions:
a. allocate_room(): Assign a room to a customer based on availability.
b. check_room_availability(): Check if rooms are available for booking.
c. release_room(): Update the room status after checkout.
3. Billing and Payment Functions:
a. generate_room_rent(): Calculate room rent based on stay duration.
b. generate_gaming_bill(): Calculate charges for gaming services used.
c. generate_fashion_store_bill(): Calculate charges for purchases at an in-
house fashion store.
d. calculate_total_bill(): Summarize all charges for the customer.
4. Database Interaction Functions:
a. connect_to_database(): Establish a connection to the MySQL database.
b. execute_query(query): Run SQL queries to manage data.
c. fetch_data(query): Retrieve data from the database.
5. Report and History Functions:
a. generate_old_bill_report(): Retrieve and display past bills.
b. generate_customer_report(): Create detailed reports for customer stay
history.
6. System Control Functions:
a. exit_system(): Safely close the application and database connections.
DATABASE TABLES:
Database Name:
• Likely named something like hotel_management or similar.
Key Tables:
1. Customers Table:
a. Purpose: To store customer information.
b. Fields:
i. customer_id (Primary Key, Integer): Unique identifier for
each customer.
ii. name (VARCHAR): Name of the customer.
iii. address (TEXT): Address details.
iv. phone_number (VARCHAR): Contact information.
v. email (VARCHAR): Email address.
2. Rooms Table:
a. Purpose: To track room details and availability.
b. Fields:
i. room_id (Primary Key, Integer): Unique identifier for each
room.
ii. room_type (VARCHAR): Type of room (e.g., Single, Double,
Suite).
iii. price (FLOAT): Cost per night.
iv. availability (BOOLEAN): Whether the room is available
(True/False).
3. Bookings Table:
a. Purpose: To manage customer bookings.
b. Fields:
i. booking_id (Primary Key, Integer): Unique identifier for each
booking.
ii. customer_id (Foreign Key, Integer): References the
Customers table.
iii. room_id (Foreign Key, Integer): References the Rooms
table.
iv. check_in_date (DATE): Customer’s check-in date.
v. check_out_date (DATE): Customer’s check-out date.
4. Bills Table:
a. Purpose: To store billing information.
b. Fields:
i. bill_id (Primary Key, Integer): Unique identifier for each bill.
ii. booking_id (Foreign Key, Integer): References the Bookings
table.
iii. room_charge (FLOAT): Charges for the room.
iv. additional_charges (FLOAT): Charges for other services
(e.g., gaming, shopping).
v. total_amount (FLOAT): Total amount billed.
5. Services Table (Optional):
a. Purpose: To manage additional services like gaming or shopping.
b. Fields:
i. service_id (Primary Key, Integer): Unique identifier for each
service.
ii. service_name (VARCHAR): Name of the service.
iii. price (FLOAT): Cost of the service.
SOURCE CODE
import mysql.connector
# GLOBAL VARIABLES DECLARATION
myConnnection =""
cursor="" userName=""
password ="”
roomrent =0
restaurentbill=0
gamingbill=0 f
ashionbill=0
totalAmount=0
cid=""
#MODULE TO CHECK MYSQL CONNECTIVITY
def MYSQLconnectionCheck ():
global myConnection
global userName
global password
userName = input("\n ENTER MYSQL SERVER'S USERNAME : ")
password = input("\n ENTER MYSQL SERVER'S PASSWORD : ")
myConnection=mysql.connector.connect(host="localhost",user=userName,pass
word , auth_plugin='mysql_native_password' )
References
1.python.org
2. Code Academy
3. tutorialsPoint.com
4. PythonChallenge.com
5. Google’s Python Class
6. LearnPython.org
7. layak.in