0% found this document useful (0 votes)
34 views29 pages

Completed Cs Project

The document outlines an investigatory project on a Lodge Management System developed using Python and CSV files, aimed at automating lodge bookings and customer management. It includes acknowledgments, project details, hardware and software requirements, an overview of Python and MySQL, advantages of both technologies, and source code for the system. The project targets small to medium-sized hotels, providing a scalable and user-friendly solution to enhance operational efficiency.

Uploaded by

prkr77993399
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views29 pages

Completed Cs Project

The document outlines an investigatory project on a Lodge Management System developed using Python and CSV files, aimed at automating lodge bookings and customer management. It includes acknowledgments, project details, hardware and software requirements, an overview of Python and MySQL, advantages of both technologies, and source code for the system. The project targets small to medium-sized hotels, providing a scalable and user-friendly solution to enhance operational efficiency.

Uploaded by

prkr77993399
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

INVESTIGATORY PROJECT ON

LODGE MANAGEMENT SYSTEM


Submitted to:

CENTRAL BOARD OF SECONDARY EDUCATION

(Academic Year: 2024-2025)

By
Ritvik Harigovind.B

Under the guidance of

Mrs. Mahalakshmi Ramesh


B.Ss., M.C.A., M.Phil., B.Ed.

SENTHIL PUBLIC SCHOOL


(Affiliated to CBSE, New Delhi, Affiliation No: 1930323)

Jagirammapalayam, Salem - 636 302.


ACKNOWLEDGEMENT

I am here overwhelmed in all humbleness and gratefulness


to acknowledge my depth to all those who have help me to put
these ideas, well above the level of simplicity and into
something concrete.
I would like to place and record my heartfelt gratitude to
my renowned Research Supervisor, Mrs.Mahalakshmi Ramesh,
B.Sc., M.C.A., M.Phil., B.Ed, Academic Coordinator, Senthil
public School, Salem, Tamil Nadu, India. Her constant support,
encouragements and guidance throughout my research periods
have played a vital role in my scientific pursuit. This helped me
immensely to throw great insight to address my research issue.
She gave me the liberty of planning and executing the research
work. Her energy and enthusiasm have developed my own
passion for research and I am truly grateful for her guidance and
encouragements.

I express my sincere and heartfelt thanks to our Senior


Principal Mr.C.Srinivasan (M.Sc, M.Phil, M.Ed, Ph.D,
Dip.in.Montessori) and our Principal Dr. V. Manoharan(M.Sc,
M.Phil, M.Ed, Ph.D) and our Academic Coordinator
Dr.T.Vinodh kumar (M.Sc, M.Phil, Ph.D, PGHM, DMLT,
B.Ed) Senthil Public School, Salem, Tamil Nadu, India, who
gave me the golden opportunity to do this wonderful project
work.
I would like to thank my parents who helped me a lot in
gathering different information, collecting data and guiding me
from time to time in making this project, despite of their busy
schedules, they gave me different ideas in making this project
unique.

RITVIK HARIGOVIND.B
INDEX

S.No Contents Page.No

1. About project 1

Hardware and
2. software 1
requirements

3. Python 5
Overview

4. CSV files 6
Overview

5. Source Code 7

6. Output screens 17

7. Bibliography 20
ABSTRACT
This project focuses on developing a Lodge
Accommodation Management System using Python and
CSV files. The system aims to streamline and automate
the management of lodge bookings, customer
information, room availability, and billing processes.
The system is designed to handle core
functionalities such as room booking, check-ins, check-
outs, and cancellations, while maintaining customer and
room data in CSV files. The use of Python ensures
flexibility, simplicity, and scalability, while CSV files
provide a lightweight and portable data storage solution.
The CSV format ensures data portability, making the
system suitable for deployment across diverse
environments. This solution targets small and medium-
sized hotels, offering a scalable and user-friendly tool for
improving operational efficiency without requiring
complex infrastructure.
HARDWARE AND SOFTWARE
REQUIREMENTS

Hardware requirements:
 Laptop
 Minimum 1GB of ram
 Minimum of 100GB HDD
 Software requirements:
 Windows operating system
Python 3. 12. 5
PYTHON OVERVIEW

Python is a high level, interpreted,


interactive and object oriented Scripted
language. Python is a designed to be
highly readable. It uses English
keywords frequently where as other
languages use punctuation, and it has
fewer syntactical constructions than
other languages.

Python is a open source and cross-


platform
Programming Language. It is available
for use under python software
foundation license (compatible to GNU
GENERAL PUBLIC LICENSE) on all
the major operating system platforms
Windows, Linux and Mac OS.
ADVANTAGES OF PYTHON
1. Ease of Learning and Use
 Simple Syntax: Python's syntax is intuitive and similar to natural
language, making it easy to learn, especially for beginners.
 Readable Code: Its clean and readable syntax reduces the effort
required to maintain and debug code.

2. Versatility and Flexibility


 General-Purpose Language: Python is suitable for a variety of
tasks, including web development, data analysis, artificial
intelligence (AI), scientific computing, and more.
 Cross-Platform: Python code can run on various operating
systems without requiring significant modifications.

3. Rich Ecosystem and Libraries


 Extensive Standard Library: Python has a vast standard library
that supports many common programming tasks, from file
manipulation to web development.
 Third-Party Libraries: Libraries like NumPy, pandas,
TensorFlow, and Flask make Python powerful for tasks like data
science, machine learning, and web development.

4. Community Support
 Large Community: Python has a massive and active community,
ensuring that developers can easily find tutorials, forums, and
support for troubleshooting.
 Frequent Updates: The community-driven development ensures
the language evolves to meet current demands.

5. Productivity and Speed


 Rapid Development: Python allows for quick prototyping due to
its simplicity and wide range of available tools.
 Fewer Lines of Code: Complex functionalities can often be
implemented with significantly less code compared to other
languages.
6. Integration and Interoperability
 Interoperable with Other Languages: Python can easily integrate
with languages like C, C++, and Java through libraries such as
Cython and Jython.
 API Integration: Python can interface with databases, REST
APIs, and cloud services effectively.

7. Applications in Cutting-Edge Fields


 Data Science and AI: Python is the preferred language for data
analysis, machine learning, and deep learning.
 Automation and Scripting: Python excels in automating
repetitive tasks and creating scripts for system management.
 Game Development: Libraries like Pygame allow for easy game
development.

8. Open-Source and Free


 Python is open-source, which means it’s free to use, distribute, and
modify. This makes it accessible to everyone, regardless of budget.

9. Portability
 Python programs can be executed across different operating
systems (Windows, macOS, Linux) without modification, provided
the required dependencies are installed.

10. Support for Multiple Programming


Paradigms
 Object-Oriented Programming (OOP): Supports creating and
managing classes and objects.
 Procedural and Functional Programming: Python allows
developers to choose the paradigm that best suits their task.
MySQL OVERVIEW

MySQL is a powerful open-source relational


database management system (RDBMS) that
stores and manages data in structured formats.
Using SQL (Structured Query Language), it
enables users to perform tasks such as
querying, updating, and administering
databases. Known for its reliability,
scalability, and speed, MySQL is widely used
in web development, data warehousing, and
enterprise applications.

Its client-server architecture ensures robust


data management, supporting features like
ACID compliance (via the InnoDB engine),
replication for high availability, and security
measures like user authentication and
encryption. MySQL integrates seamlessly with
popular programming languages and
platforms, making it a preferred choice for
developers across industries.
ADVANTAGES OF MySQL

1. Open-Source and Free


 The Community Edition is free to use, and the source code
is open, allowing customization and transparency.

2. High Performance
 Optimized for fast read and write operations, MySQL is
ideal for web applications, supporting millions of queries
per second.

3. Scalability
 Handles databases of all sizes, from small-scale projects to
enterprise-level applications, and supports horizontal
scaling through replication.

4. Cross-Platform Compatibility
 Runs on multiple operating systems, including Windows,
Linux, and macOS, making it versatile and portable.

5. Wide Ecosystem and Integration


 Easily integrates with popular programming languages like
Python, PHP, and Java and is often used with frameworks
like Django, Laravel, and Spring.
6. Security
 Features robust security measures like user authentication,
data encryption, and fine-grained access control for safe
data management.

7. Replication and High Availability


 Supports master-slave replication and clustering to ensure
data redundancy and high availability for critical systems.

8. Ease of Use
 User-friendly tools like MySQL Workbench provide
graphical interfaces for database modeling, management,
and administration.

9. Rich Features
 ACID compliance (via InnoDB engine), support for
transactions, stored procedures, and triggers provide
flexibility and reliability for complex applications.

10. Active Community and Enterprise


Support
 A large, active user community ensures abundant
resources for troubleshooting, and enterprise support
options are available for advanced needs.
HOW PYTHON AND MySQL
WORK TOGETHER

Python and MySQL work seamlessly together,


allowing developers to interact with MySQL
databases directly from Python code. By using
libraries such as MySQL Connector or
PyMySQL, Python applications can connect to a
MySQL database, execute SQL queries, and
retrieve or modify data. These libraries provide a
simple interface for Python developers to manage
database operations like inserting records, updating
tables, or running complex queries.

The combination of Python's flexibility and


MySQL's reliable data storage makes it ideal for
building data-driven applications. Python can
handle data processing and analysis, while MySQL
stores and manages the data efficiently. This
synergy is commonly used in web development,
data science, and automation, where Python scripts
interface with MySQL databases to retrieve,
manipulate, and present data in real-time.
SOURCE CODE

import mysql.connector
from datetime import datetime

# Connect to the MySQL server with provided


credentials
db = mysql.connector.connect(host="localhost",
user="asa", passwd="1234", database="hotel")
cursor = db.cursor()

# Enhanced table creation with added constraints and


details
cursor.execute("""
CREATE TABLE IF NOT EXISTS rooms (
room_id INT AUTO_INCREMENT PRIMARY KEY,
room_type VARCHAR(20) NOT NULL,
price_per_night INT NOT NULL,
status VARCHAR(10) DEFAULT 'Available',
room_description TEXT
)
""")

cursor.execute("""
CREATE TABLE IF NOT EXISTS guests (
guest_id INT AUTO_INCREMENT PRIMARY KEY,
guest_name VARCHAR(50) NOT NULL,
contact_no BIGINT NOT NULL,
email VARCHAR(100),
address TEXT
)
""")

cursor.execute("""
CREATE TABLE IF NOT EXISTS bookings (
booking_id INT AUTO_INCREMENT PRIMARY KEY,
guest_id INT,
room_id INT,
check_in DATE,
check_out DATE,
total_cost INT DEFAULT 0,
booking_status VARCHAR(20) DEFAULT 'Active',
FOREIGN KEY (guest_id) REFERENCES
guests(guest_id),
FOREIGN KEY (room_id) REFERENCES rooms(room_id)
)
""")

cursor.execute("""
CREATE TABLE IF NOT EXISTS food_items (
food_id INT AUTO_INCREMENT PRIMARY KEY,
food_name VARCHAR(50) NOT NULL,
price INT NOT NULL,
food_description TEXT
)
""")

cursor.execute("""
CREATE TABLE IF NOT EXISTS room_service (
service_id INT AUTO_INCREMENT PRIMARY KEY,
booking_id INT,
food_id INT,
quantity INT NOT NULL,
total_price INT NOT NULL,
service_time TIMESTAMP DEFAULT
CURRENT_TIMESTAMP,
FOREIGN KEY (booking_id) REFERENCES
bookings(booking_id),
FOREIGN KEY (food_id) REFERENCES
food_items(food_id)
)
""")

cursor.execute("""
CREATE TABLE IF NOT EXISTS bills (
bill_id INT AUTO_INCREMENT PRIMARY KEY,
booking_id INT,
total_room_cost INT,
total_food_cost INT,
grand_total INT,
payment_status VARCHAR(20) DEFAULT 'Pending',
payment_method VARCHAR(20),
FOREIGN KEY (booking_id) REFERENCES
bookings(booking_id)
)
""")
db.commit()

# Function Definitions
def add_guest():
name = input("Enter guest name: ")
contact = input("Enter contact number: ")
email = input("Enter email address (optional): ")
address = input("Enter address (optional): ")
cursor.execute("INSERT INTO guests (guest_name,
contact_no, email, address) VALUES (%s, %s, %s, %s)",
(name, contact, email, address))
db.commit()
print("Guest added successfully.")

def add_room():
room_type = input("Enter room type (e.g., Single,
Double, Suite): ")
price = int(input("Enter price per night: "))
description = input("Enter room description
(optional): ")
cursor.execute("INSERT INTO rooms (room_type,
price_per_night, room_description) VALUES (%s, %s,
%s)",
(room_type, price, description))
db.commit()
print("Room added successfully.")

def book_room():
guest_id = int(input("Enter guest ID: "))
room_id = int(input("Enter room ID: "))
check_in = input("Enter check-in date (YYYY-MM-DD):
")
check_out = input("Enter check-out date (YYYY-MM-
DD): ")
cursor.execute("SELECT status, price_per_night FROM
rooms WHERE room_id = %s", (room_id,))
room_info = cursor.fetchone()
if room_info[0] == 'Booked':
print("Room is currently unavailable.")
return

price = room_info[1]
total_days = (datetime.strptime(check_out, "%Y-%m-
%d") - datetime.strptime(check_in, "%Y-%m-%d")).days
total_cost = total_days * price
cursor.execute("INSERT INTO bookings (guest_id,
room_id, check_in, check_out, total_cost) VALUES (%s,
%s, %s, %s, %s)",
(guest_id, room_id, check_in, check_out,
total_cost))
cursor.execute("UPDATE rooms SET status = 'Booked'
WHERE room_id = %s", (room_id,))
db.commit()
print("Room booked successfully with a total cost of:",
total_cost)

def add_food_item():
food_name = input("Enter food item name: ")
price = int(input("Enter price: "))
description = input("Enter food description (optional):
")
cursor.execute("INSERT INTO food_items
(food_name, price, food_description) VALUES (%s, %s,
%s)",
(food_name, price, description))
db.commit()
print("Food item added successfully.")

def room_service():
booking_id = int(input("Enter booking ID: "))
food_id = int(input("Enter food ID: "))
quantity = int(input("Enter quantity: "))
cursor.execute("SELECT price FROM food_items
WHERE food_id = %s", (food_id,))
food_price = cursor.fetchone()[0]
total_price = food_price * quantity
cursor.execute("INSERT INTO room_service
(booking_id, food_id, quantity, total_price) VALUES (%s,
%s, %s, %s)",
(booking_id, food_id, quantity, total_price))
db.commit()
print("Room service added successfully with a total
cost of:", total_price)

def check_out():
booking_id = int(input("Enter booking ID for check-
out: "))
cursor.execute("SELECT total_cost FROM bookings
WHERE booking_id = %s", (booking_id,))
room_cost = cursor.fetchone()[0]

cursor.execute("""
SELECT SUM(f.price * s.quantity) FROM room_service
s
JOIN food_items f ON s.food_id = f.food_id
WHERE s.booking_id = %s
""", (booking_id,))
food_cost = cursor.fetchone()[0] or 0
grand_total = room_cost + food_cost

payment_method = input("Enter payment method


(e.g., Cash, Credit Card): ")
cursor.execute("""
INSERT INTO bills (booking_id, total_room_cost,
total_food_cost, grand_total, payment_method)
VALUES (%s, %s, %s, %s, %s)
""", (booking_id, room_cost, food_cost, grand_total,
payment_method))
cursor.execute("UPDATE rooms r JOIN bookings b ON
r.room_id = b.room_id SET r.status = 'Available' WHERE
b.booking_id = %s", (booking_id,))
db.commit()
print(f"Guest checked out. Total bill is {grand_total}")

def view_rooms():
cursor.execute("SELECT * FROM rooms")
for room in cursor.fetchall():
print("Room ID:", room[0], "| Type:", room[1], "|
Price per Night:", room[2], "| Status:", room[3], "|
Description:", room[4])

def view_guests():
cursor.execute("SELECT * FROM guests")
for guest in cursor.fetchall():
print("Guest ID:", guest[0], "| Name:", guest[1], "|
Contact:", guest[2], "| Email:", guest[3], "| Address:",
guest[4])
def view_bookings():
cursor.execute("""
SELECT b.booking_id, g.guest_name, r.room_type,
b.check_in, b.check_out, b.total_cost, b.booking_status
FROM bookings b
JOIN guests g ON b.guest_id = g.guest_id
JOIN rooms r ON b.room_id = r.room_id
""")
for booking in cursor.fetchall():
print("Booking ID:", booking[0], "| Guest Name:",
booking[1], "| Room Type:", booking[2],
"| Check-in:", booking[3], "| Check-out:",
booking[4], "| Total Cost:", booking[5], "| Status:",
booking[6])

def view_bills():
cursor.execute("""
SELECT bl.bill_id, g.guest_name, r.room_type,
bl.total_room_cost, bl.total_food_cost, bl.grand_total,
bl.payment_status
FROM bills bl
JOIN bookings b ON bl.booking_id = b.booking_id
JOIN guests g ON b.guest_id = g.guest_id
JOIN rooms r ON b.room_id = r.room_id
""")
for bill in cursor.fetchall():
print("Bill ID:", bill[0], "| Guest Name:", bill[1], "|
Room Type:", bill[2],
"| Room Cost:", bill[3], "| Food Cost:", bill[4], "|
Grand Total:", bill[5], "| Payment Status:", bill[6])
# Main Menu
def main_menu():
while True:
print("\n***** HOTEL MANAGEMENT SYSTEM
*****")
print("1. Add Guest")
print("2. Add Room")
print("3. Book Room")
print("4. Add Food Item")
print("5. Room Service")
print("6. Check-Out")
print("7. View Rooms")
print("8. View Guests")
print("9. View Bookings")
print("10. View Bills")
print("11. Exit")

try:
choice = int(input("Enter your choice: "))
except ValueError:
print("Invalid choice! Please enter a number
between 1 and 11.")
continue

if choice == 1:
add_guest()
elif choice == 2:
add_room()
elif choice == 3:
book_room()
elif choice == 4:
add_food_item()
elif choice == 5:
room_service()
elif choice == 6:
check_out()
elif choice == 7:
view_rooms()
elif choice == 8:
view_guests()
elif choice == 9:
view_bookings()
elif choice == 10:
view_bills()
elif choice == 11:
print("Exiting the system.")
break
else:
print("Invalid choice! Please try again.")

# Run the main menu


main_menu()

# Close the database connection


cursor.close()
db.close()
OUTPUT SCREENS
BIBILOGRAPHY

Progress in computer with python


-Dhanpat Rai & Co. [Publisher]

-Sumita Arora [Author]

Computer science with python


-Sultan chand [Publisher]

-Preeti Arora [Author]

Computer science:
-New Saraswathi house
[Publisher]

-Harsha basin [ Auhtor]

You might also like