ACKNOWLEDGEMENT
Foremost we the associates of the project “HOTEL MANAGEMENT
SYSTEM” convey our gratitude and heartfelt thanks to our Computer
Science Teacher Mr. D PRABHAKARAN, KAMARAJ ENGLISH MEDIUM
SENIOR SECONDARY SCHOOL, PORT BLAIR, for encouraging me in our
entire endeavour and permitting me to take up this project.
I also extend my humble thanks to the respected principal, Mrs. V S
BEENA, for her guidance, encouragement, constant review on the
progress of the project and her moral support for providing all the
requirements and inspiring us throughout this project.
For the execution of this project and report I also show my Zealous
gratitude to other teaching staffs of our school for bestowing their
valuable ideas and also imbibing in us the necessary human values like
‘Team Work’ without which I wouldn’t have dared to undertake this
project.
Introduction & Objective
Introduction:
In the bustling hospitality industry, effective management is the
cornerstone of providing exceptional guest experiences and maintaining
operational efficiency. The Hotel Management System (HMS) project,
developed using Python programming language and MySQL database,
seeks to revolutionize the way hotels handle their day-to-day operations.
This comprehensive system is designed to address the intricate needs of
hotel management, from reservation and check-in to room service and
billing, fostering an environment where both guests and staff can thrive.
The Hotel Management System integrates the power of Python for its
versatility and ease of integration with diverse technologies, while MySQL
serves as a robust and scalable database management solution. This
amalgamation of technologies ensures a seamless and responsive
platform that can adapt to the unique demands of hotels of varying sizes
and requirements.
Key Features:
Reservation Management:
Streamlining the reservation process, allowing guests to book rooms
online or through the hotel reception.
Real-time updates on room availability and automated reservation
confirmations.
Check-In/Check-Out:
Efficient check-in and check-out procedures, minimizing guest wait times.
Integration with guest profiles for personalized services and preferences.
Room and Inventory Management:
Dynamic management of room assignments, ensuring optimal utilization
of available spaces.
Tracking and management of hotel inventory, including linens, toiletries,
and other amenities.
Billing and Invoicing:
Automated billing processes for room charges, additional services, and
miscellaneous expenses.
Generation of detailed invoices and receipts for guest records.
Point of Sale (POS) Integration:
Seamless integration with POS systems for managing restaurant, bar, and
other service transactions within the hotel.
Unified billing system for guest convenience.
Staff Management:
User-friendly interfaces for hotel staff to manage reservations, check-ins,
and other operational tasks.
Access control mechanisms to ensure data security and privacy.
Reporting and Analytics;
Generation of comprehensive reports on occupancy rates, revenue, and
other key performance indicators.
Data analytics tools for insights into guest preferences and operational
efficiency.
Customer Relationship Management (CRM):
Maintaining guest profiles for personalized services and future
engagement.
Automated communication, including confirmation emails and post-stay
feedback requests.
Security and Compliance:
Implementation of robust security measures to protect guest data and
ensure compliance with privacy regulations.
Regular updates and patches to address potential security vulnerabilities.
Scalability and Customization:
Designing the system to be scalable for hotels of varying sizes and
adapting to specific business requirements.
Customization options to tailor the system to the branding and operational
nuances of individual hotels.
The Hotel Management System project envisions a technology-driven
approach to hotel administration, optimizing processes and enhancing the
overall guest experience. With its user-friendly interface and powerful
backend technologies, this system is poised to become an invaluable
asset for hotels seeking to stay competitive and deliver unparalleled
hospitality services.
Scope of the Project
The Hotel Management System (HMS) project aims to develop a
comprehensive and scalable solution for the efficient management of
hotel operations, leveraging the capabilities of Python programming
language and MySQL database. The scope of the project encompasses a
wide range of functionalities to address the diverse needs of the
hospitality industry, ensuring seamless day-to-day operations, enhanced
guest experiences, and streamlined administrative processes. The key
components of the project scope include:
Online and offline reservation capabilities to facilitate guest bookings.
Real-time updates on room availability and automated reservation
confirmations.
Efficient and user-friendly check-in and check-out processes.
Integration with guest profiles to provide personalized services and
preferences.
Dynamic management of room assignments to optimize occupancy.
Inventory tracking for linens, toiletries, and other amenities to ensure
adequate supplies.
Billing and Invoicing:
Automated billing processes for room charges, additional services, and
miscellaneous expenses.
Generation of detailed invoices and receipts for guest records.
Point of Sale (POS) Integration:
Integration with POS systems to manage restaurant, bar, and other
service transactions.
Unified billing system to streamline guest payments.
Staff Management:
User-friendly interfaces for hotel staff to manage reservations, check-ins,
and operational tasks.
Access control mechanisms to ensure data security and privacy.
Reporting and Analytics:
Generation of comprehensive reports on occupancy rates, revenue, and
other key performance indicators.
Data analytics tools for insights into guest preferences and operational
efficiency.
Customer Relationship Management (CRM):
Maintenance of guest profiles for personalized services and future
engagement.
Automated communication, including confirmation emails and post-stay
feedback requests.
Security and Compliance:
Implementation of robust security measures to protect guest data.
Adherence to privacy regulations and regular updates to address security
vulnerabilities.
Scalability and Customization:
Designing the system to be scalable, catering to hotels of various sizes
and complexities.
Customization options to adapt the system to the unique branding and
operational requirements of individual hotels.
Mobile Compatibility:
Responsive design for mobile devices, allowing guests to access services
and make reservations on the go.
Integration with External Systems:
Compatibility with external systems, such as payment gateways and third-
party APIs, to enhance functionality.
The Hotel Management System project will be developed iteratively, with
ongoing feedback from stakeholders to incorporate refinements and
enhancements. The scope is designed to cover the fundamental aspects
of hotel operations, providing a robust and adaptable solution for hotels
seeking to optimize their management processes and elevate the overall
guest experience.
Python Overview
Python, created by Guido van Rossum and first released in 1991, is a
versatile, high-level programming language known for its readability,
simplicity, and flexibility. It has gained widespread popularity across
various domains, from web development to scientific computing, data
analysis, artificial intelligence, and more. Here's an overview of key
aspects of Python:
Readability and Simplicity:
Python emphasizes readability, using a clean and straightforward syntax.
The language's design philosophy prioritizes code readability, making it an
ideal choice for beginners and experienced developers alike.
General-Purpose Language:
Python is a general-purpose programming language, suitable for a wide
range of applications.
It supports both procedural and object-oriented programming paradigms.
Interpreted and Interactive:
Python is an interpreted language, which means that code can be
executed line by line, facilitating debugging and testing.
Interactive Python shells (such as IDLE or Jupyter Notebooks) enable real-
time code execution and experimentation.
Extensive Standard Library:
Python comes with a rich standard library that provides modules and
packages for various tasks, reducing the need for external dependencies.
The standard library covers areas like file I/O, networking, regular
expressions, and more.
Dynamic Typing and Memory Management:
Python is dynamically typed, allowing developers to assign values without
declaring the variable type explicitly.
Memory management is handled by a built-in garbage collector,
simplifying memory allocation and deallocation.
High-Level Data Structures:
Python provides built-in high-level data structures like lists, dictionaries,
sets, and tuples.
These data structures, along with their associated methods, make it easy
to implement complex algorithms and data manipulations.
Community and Ecosystem:
Python has a vibrant and active community of developers worldwide.
The Python Package Index (PyPI) hosts a vast collection of third-party
libraries and frameworks, contributing to the language's ecosystem.
Versatility in Application Domains:
Python is widely used in various domains, including web development
(Django, Flask), data science (NumPy, pandas), machine learning
(TensorFlow, PyTorch), and automation (scripting, system administration).
Cross-Platform Compatibility:
Python is cross-platform, meaning code written in Python can run on
different operating systems without modification.
This portability enhances its suitability for diverse environments.
Open Source and Community-Driven Development:
Python is an open-source language, and its development is guided by the
Python Enhancement Proposals (PEP) process.
The community actively contributes to language improvements, bug fixes,
and new features.
Popularity and Industry Adoption:
Python has consistently ranked among the top programming languages in
popularity indices.
Its ease of learning and extensive community support contribute to its
widespread adoption in academia, industry, and the tech community.
In summary, Python's readability, versatility, and extensive community
support have made it a preferred choice for developers across various
domains. Its user-friendly syntax and powerful features make it an
excellent language for both beginners and experienced programmers.
Hardware and Software Requirement
Front End:
Python3.8.2
INSTALL MYNSQL.CONECTOR
Back End:
My Sql
Operating System:
Windows10
Hardware Requirements:
Operating System:
x86 64-bit CPU (Intel / AMD architecture)
4 GB RAM.
5 GB free disk space.
Source Code
import csv
import math
import os
import datetime
def ShowMenu():
print("\n\n\n\t\t############ HOTEL
YATRIK ###############")
print("\n\t\t\t 1. CHECK-IN ")
print("\n\t\t\t 2. CHECK-OUT ")
print("\n\t\t\t 3. ALL ROOM STATUS ")
print("\n\t\t\t 4. OTHER EXPENSES ")
print("\n\t\t\t 5. ROOM ENQUIRY ")
print("\n\t\t\t 6. CONTACT DETAIL")
print("\n\t\t\t 0. LOG OUT ")
print("\t\
t################################
#########")
def ShowAllRoomStatus():
with open('rooms.csv',mode='r') as csvfile:
myreader =
csv.reader(csvfile,delimiter=',')
print("="*75)
print("%10s"%"FLOOR","%15s"%"ROOM
NUMBER","%20s"%"ROOM TYPE","%15s"%"ROOM
STATUS",'%10s'%'RATE')
print("="*75)
for row in myreader:
if row[2]=="D":
rtype="DELUXE"
elif row[2]=="SD":
rtype="SEMI-DELUXE"
elif row[2]=="SDX":
rtype="SUPER DELUXE"
elif row[2]=="HDX":
rtype="EXECUTIVE SUITE"
if row[3]=="V":
status="VACANT"
else:
status ="OCCUPIED"
print("%10s"%row[0],"%15s"%row[1],"%20s"%rtype,"
%15s"%status,'%10s'%row[4])
print("="*75)
input('Press any key...')
def CheckRoomVacant(roomno):
with open('rooms.csv',mode='r') as csvfile:
myreader =
csv.reader(csvfile,delimiter=',')
found=False
for row in myreader:
if len(row)>0:
if str(row[1])==str(roomno):
found=True
return row[3],row[4]
if not found:
return 'INVALID'
input('Press any key...')
def CheckIn():
print('\n\n\t\t################# NEW
VISITOR ARRIVAL
#######################')
Visitor_Number=None
if os.path.exists('Visitor.csv'):
with open('Visitor.csv',mode='r') as
csvfile:
myreader =
csv.reader(csvfile,delimiter=',')
l = len(list(myreader))
Visitor_Number = l + 1
else:
Visitor_Number = 1
dt = datetime.datetime.now()
today = str(dt.day)+'/'+str(dt.month)
+'/'+str(dt.year)+' '+str(dt.hour)+':'+str(dt.minute)
+':'+str(dt.second)
print('\n\t\t\t\t\t\t\t Today is :'+today)
print('\n\t\t Visitor Number :',Visitor_Number)
name = input('\t\t Enter Visitor Name :')
ID = input('\t\t Enter What Photo ID number :')
age = int(input('\t\t Enter Age :'))
gender = input('\t\t Choose gender 1-Male, 2-
Female, 3-Transgender')
coming_from = input('\t\t Enter the Place from
where person is coming :')
purpose = input('\t\t Enter purpose of Visit :')
mobile = input('\t\t Enter Mobile Number :')
c='go'
roomno=0
while c=='go':
roomno = int(input('\t\t Enter Room
Number :'))
status = CheckRoomVacant(roomno)
if status[0]=='INVALID':
print('Enter Valid room number :')
elif status[0]=='V':
c='OK'
else:
print('Room Number not Vacant')
print('\t\t Check in Date and Time :',today)
print('\t\t Room Rent @'+str(status[1])+' Day')
print('\t\t Advance To Pay :'+str(status[1]))
ans = input('\n\t\t Confirm?(y)')
if ans.lower()=='y':
visitors=[Visitor_Number,name,ID,age,gender,coming
_from,purpose,roomno,today,status[1],mobile]
with open('Visitor.csv','a') as vfile:
mywriter =
csv.writer(vfile,delimiter=',',lineterminator='\n')
mywriter.writerow(visitors)
print('\n\t\t Checked In Successfully!')
room=[]
with open('rooms.csv','r') as rcsv:
myreader =
csv.reader(rcsv,delimiter=',')
for row in myreader:
if len(row)>0:
room.append(row)
#print(row)
with open('rooms.csv','w') as rcsv:
mywriter =
csv.writer(rcsv,delimiter=',',lineterminator='\n')
for i in range(len(list(room))):
if room[i][1]==str(roomno):
room[i][3]='O'
#print(room[i])
mywriter.writerow(room[i])
def OtherExpense():
print("="*30," OTHER EXPENSE SCREEN ",
"="*30)
visitors=[]
with open('Visitor.csv','r') as csvroom:
myreader =
csv.reader(csvroom,delimiter=',')
for row in myreader:
visitors.append(row)
vno = input('\n\t\t ENTER VISITOR NO :')
found=False
for rs in visitors:
if rs[0]==vno:
food = int(input('Enter Food
Expense (0 if no expense):'))
laundry = int(input('Enter Laundry
Expense (0 if no expense) :'))
misc = int(input('Enter any other
expense (0 if no expense) :'))
with open('expense.csv','a') as
expcsv:
mywriter =
csv.writer(expcsv,delimiter=',',lineterminator='\n')
today =
datetime.datetime.now()
today = str(today.day)
+'/'+str(today.month)+'/'+str(today.year)
exp =
[vno,food,laundry,misc,today]
mywriter.writerow(exp)
found=True
if not found:
print("\n### SORRY ROOM NUMBER NOT
OCCUPIED ###")
def CheckOut():
print('\n\n')
print('='*30,' CHECK OUT SCREEN ' , '='*30)
roomstatus=[]
with open('rooms.csv','r') as csvroom:
myreader =
csv.reader(csvroom,delimiter=',')
for row in myreader:
roomstatus.append(row)
rno = input('\n\t\t ENTER ROOM NO :')
found=False
vis=[]
fexp=0
lexp=0
mexp=0
total=0
oexp=0
for rs in roomstatus:
if rs[1]==rno and rs[3]=='O':
total=total + int(rs[4])
print('Checking....')
with open('Visitor.csv','r') as vcsv:
myreader =
csv.reader(vcsv,delimiter=',')
for row in myreader:
if rno == row[7]:
vis = row
print("In")
with open('expense.csv','r') as
ecsv:
myreader =
csv.reader(ecsv,delimiter=',')
for row in myreader:
if row[0]==vis[0]:
fexp = fexp +
int(row[1])
lexp = lexp +
int(row[2])
mexp = mexp +
int(row[3])
oexp = fexp + lexp + mexp
found=True
if not found:
print('## ROOM NOT BOOKED ##')
else:
today = datetime.datetime.now()
today = str(today.day)
+'/'+str(today.month)+'/'+str(today.year)+'
'+str(today.hour)+':'+str(today.minute)
+':'+str(today.second)
print('\n\n')
print('='*30,'CHECK OUT (BILL)','='*30)
print('\t\t CHECK IN DATE : ',vis[8])
print('\t\t CHECK OUT DATE :',today)
print('-'*75)
print('\t\t Visitor Number : ',vis[0])
print('\t\t Visitor Name : ',vis[1])
print('\t\t Visitor Age : ',vis[3])
g=''
if vis[4]=='1':
g='Male'
else:
g='Female'
print('\t\t Visitor Gender : ',g)
print('\t\t Coming From : ',vis[5])
print('\t\t Purpose of Visit: ',vis[6])
print('-'*75)
d1 =
datetime.datetime.strptime(vis[8],"%d/%m/%Y %H:
%M:%S")
d2 =
datetime.datetime.strptime(today,"%d/%m/%Y %H:
%M:%S")
d3 = d2-d1
day=0
if d3.days<=1:
day=1
else:
day = math.ceil(d3.days)
print('\n\t\t Total days :',day)
print('\t\t Room Rent
@'+str(total)+'/Day :Rs.',total*day)
print('\t\t Food Expense :Rs.',fexp)
print('\t\t Laundry Expense :Rs.',lexp)
print('\t\t Misc. Expense :Rs.',mexp)
print('-'*75)
print('\t\t\t GRAND TOTAL : Rs.',
(total+oexp))
def RoomEnquiry():
print('\n\n')
print('='*30,' VISITOR ENQUIRY SCREEN ' ,
'='*30)
vn = input("\n\t\t ENTER VISITOR NAME : ")
fs = "%5s %-15s %6s %10s %15s %15s %8s %-
20s"
print(fs % ("VID","VISITOR
NAME","AGE","GENDER","COMING
FROM","PURPOSE","ROOMNO","CHECKIN DATE"))
print("="*110)
found=False
gender=''
with open('Visitor.csv','r') as vcsv:
myreader = csv.reader(vcsv,delimiter=',')
for row in myreader:
if row[1].lower()==vn.lower():
if row[4]=='1':
gender='Male'
else:
gender='Female'
print(fs%
(row[0],row[1],row[3],gender,row[5],row[6],row[7],row
[8]))
found=True
print("="*110)
if not found:
print("\n\t\t\t VISITOR NAME NOT FOUND
")
def Contact():
print("\n\
n==============================
CONTACT INFORMATION
==============================")
print("\n\t\t Project Name : YATRIK HOTEL
MANAGEMENT SYSTEM ")
print("\n\t\t Developed By : VINOD KUMAR
VERMA ")
print("\n\t\t Language : PYTHON ")
print("\n\t\t Topic : CSV FILE HANDLING ")
print("\n\t\t E-Mail :
[email protected]")
choice=0
while choice!=None:
ShowMenu()
choice = int(input('\t\t\t ENTER YOUR
CHOICE :'))
if choice==1:
CheckIn()
elif choice==2:
CheckOut()
elif choice==3:
ShowAllRoomStatus()
elif choice==4:
OtherExpense()
elif choice==5:
RoomEnquiry()
elif choice==6:
Contact()
elif choice==0:
choice=None
print('\n\t\t\t THANK YOU! ')
else:
print('\n\t\t\t == INVALID CHOICE == ')
Output Screen and Database
Structure
Output Screen
Bibliography
1. Computer Science with Python -Sumita Arora
2. www.freecomputerbooks.com
3. www.W3schools.org
4.
www.picshub.org/prabha’s/institute/of/computerscienc
e