CS Project
CS Project
PROJECT REPORT
COMPUTER SCIENCE
Topic: PARKING MANAGEMENT
Academic year: 2024 – 2025
DONE BY:
R.MURALIKRISHNA(XII-A)
T.HARRY JOSEPH(XII-A)
S.PRADEEP(XII-A)
1
SHIKSHAA PUBLIC SCHOOL
CHROMPET, CHENNAI-64
Date: Date:
___________________
2
Signature of the Principal
Acknowledgement
I would like to express my greatest appreciation to the all
individuals who have helped and supported me throughout the
project which led to its success and final outcome of this project.
It required a lot of guidance and assistance from many people and I
am extremely fortunate to receive such help throughout the project
work. Whatever I have done is only due to such guidance and
assistance and I would not forget to thank them.
I am thankful to my computer teacher Mrs. Arun Saranya for her
ongoing support during the project, from initial advice, and
encouragement, which led to the final report of this project.
I would also like to thank my team members T.Harry joseph,
R.Murali krishna who were always there in to help me.
A special acknowledgement goes to my classmates who helped me
in completing the project by exchanging interesting ideas and
sharing their experience.
I wish to thank my parents as well for their undivided support and
interest who inspired me and encouraged me to go my own way,
without whom I would be unable to complete my project.
At the end, I want to thank everyone who displayed appreciation to
my work and motivated me to continue my work.
3
TABLE OF CONTENTS:
1. ABSTRACT 5
2. SYSTEM CONFIGURATION 6
3. INTRODUCTION 7
i) PYTHON
ii) MYSQL
4. RELATION BETWEEN PYTHON AND MYSQL 11
5. DATABASE CONNECTIVITY 12
7. DATABASE SCHEMA 13
9. SOURCE CODE 14
10. OUTPUT 19
11. CONCLUSION 23
12. BIBLIOGRAPHY 25
4
1.ABSTRACT
In urban environments, the efficient management of parking resources is crucial for alleviating traffic
congestion, enhancing accessibility, and reducing the environmental impact of vehicle emissions. This paper
presents a detailed parking management system (PMS) developed using Python and MySQL, specifically
designed for application in malls and corporate facilities. Unlike traditional systems that rely on sensors, this
PMS utilizes manual input methods for data entry and management, making it a flexible solution for various
operational contexts.
The proposed system allows users and facility managers to manually input parking space availability and
occupancy status through an intuitive interface. The backend, developed in Python and supported by a MySQL
database, processes this data to provide real-time updates on parking availability. Users can easily access the
system via a mobile application that facilitates locating available parking spaces, reserving spots in advance,
and processing payments seamlessly. The app connects to the MySQL database to ensure accurate information
is readily available.
Dynamic pricing strategies are incorporated, allowing facility managers to adjust rates based on demand and
occupancy patterns, which are tracked through manual entries. Users benefit from features such as GPS
navigation to guide them to their selected parking locations, as well as notifications for space availability and
reminders for upcoming reservations. The integration with digital payment platforms ensures quick and secure
transactions, enhancing the overall user experience.
A pilot implementation of the PMS was conducted in several malls and corporate campuses, where data
collected over multiple months demonstrated significant improvements in parking efficiency. Average search
time for parking decreased from approximately 15 minutes to just 5 minutes, while turnover rates in parking
facilities increased by up to 30% during peak hours. User satisfaction ratings improved markedly, with feedback
highlighting the convenience and efficiency of the system in high-traffic environments.
The system’s ability to provide actionable insights into parking behavior not only enhances user experience but
also aids facility managers in making informed decisions regarding parking operations and space allocation.
Analytics generated from manual inputs offer valuable information on peak usage times, revenue generation,
and potential areas for expansion, which can inform future management strategies.
Moreover, the system can integrate with corporate shuttle services and public transportation networks to
promote multimodal transport solutions, encouraging users to combine parking with transit options. This
5
integration aligns with sustainability goals, as it can lead to a reduction in overall vehicle use, thereby lowering
carbon emissions in urban settings.
The findings suggest that this manual-input-based parking management solution, developed with Python and
MySQL, can significantly enhance the efficiency of parking operations in malls and corporate environments.
This contributes to the broader objectives of smart city initiatives by promoting sustainability, improving urban
mobility, and enhancing the quality of life for residents and visitors alike. Future work will focus on scaling the
system to accommodate additional facilities, exploring partnerships with local businesses and government
entities, and evaluating long-term impacts on traffic dynamics and economic activity. Ultimately, this research
aims to establish a robust framework for developing intelligent parking solutions that adapt to the evolving
needs of urban populations, particularly in high-traffic commercial areas.
2.SYSTEM CONFIGURATION
HARDWARE CONFIGURATION
SOFTWARE REQUIREMENTS:
• Basic GPU – Any vendor DirectX 9.0 class or better (Pixel Shader Level 2)
6
3.INTRODUCTION
i) PYTHON:
Python is a high-level, interpreted scripting language developed in the late 1980s by Guidovan Rossum at the
National Research Institute for Mathematics and Computer Science in the Netherlands. The initial version was
published at the outsources newsgroup in 1991, and version 1.0 was released in 1994.
Python 2.0 was released in 2000, and the 2.x versions were the prevalent releases until December 2008. At that
time, the development team made the decision to release version 3.0, which contained a few relatively small but
significant changes that were not backward compatible with the 2.x versions. Python 2 and 3 are very similar,
and some features of Python 3 have been backported to Python 2. But in general, they remain not quite
compatible.
As of this writing, the most recent python version available is 3.11.0. An official end of life of January 1,2020
has been established for Python 2, after which time it will no longer be maintained.
Python is still maintained by a core development team at the Institute, and Guido is still in charge, having been
given the title of BDFL (Benevolent Dictator for Life) by the Python community. The name Python derives not
from the snake, but from the British comedy troupe Monty Python’s Flying Circus, of which Guido was, and
presumably still is, a fan. It is common to find references to Monty Python sketches and movies scattered
throughout the Python documentation.
Python is Popular
Python has been growing in popularity over the last few years. The 2018 Stack Overflow Developer Survey
ranked Python as the 7th most popular and the number one most wanted technology of the year. World-class
software development countries around the globe use Python every single day. According to research by Dice,
Python is also one of the hottest skills to have and the most popular programming language in the world based
on the Popularity of programming Language Index.
Python is Interpreted
Many languages are compiled, meaning the source code you create needs to be translated into machine code,
the language of your computer’s processor, before it can be run. Programs written in an interpreted language are
passed straight to an interpreter that runs them directly. This makes for a quicker development cycle because
you just type in your code and unit, without the intermediate compilation step. One potential downside to
interpreted languages is execution speed. Programs that are compiled into the native language of the computer
processor tend to run more quickly than interpreted programs. For some applications that are particularly
computationally intensive, like graphics processing or intense number crunching, this can be limiting.
In practice, however, for most programs, the difference in execution speed is measured in milliseconds, or
seconds at most, and not appreciably noticeable to a human user. The expediency of coding in an interpreted
language is typically worth it for most applications.
7
Python is Free
The Python interpreter is developed under an OSI-approved open-source license, making it free to install, use,
and distribute, even for commercial purposes.
A version of the interpreter is available for virtually any platform there is, including all flavors of Unix,
Windows, macOS, smartphones and tablets, and probably anything else you ever heard of. A version even
exists for the half dozen people remaining who use OS/2.
Python is Portable
Because Python code is interpreted and not compiled into native machine instructions, code written for one
platform will work on any other platform that has the Python interpreter installed. (This is true of any
interpreted language, not just Python.
Python is Simple
As programming languages go, Python is relatively uncluttered, and the developers have deliberately kept it that
way. A rough estimate of the complexity of a language can be gleaned from the number of keywords or
reserved words in the language. These are words that are reserved for special meaning by the compiler or
interpreter because they designate specific built-in functionality of the language. Python 3 has 33 keywords, and
Python 2 has 31. By contrast, C++ has 62, Java has 53, and Visual Basic has more than 120, though these latter
examples probably vary somewhat by implementation or dialect.
8
ii) MYSQL:
Database Management System:
A Database Management System (DBMS) is a software application that interacts with the user, applications
and the database itself to capture and analyse data. The data stored in the database can be modified, retrieved
and deleted, and can be of any type like strings, numbers, images etc.
Types of DBMS:
There are mainly 4 types of DBMS, which are Hierarchical, Relational, Network, and Object-Oriented DBMS.
Hierarchical DBMS: As the name suggests, this type of DBMS has a style of predecessor-successor type of
relationship. So, it has a structure similar to that of a tree, wherein the nodes represent records and the branches
of the tree represent fields.
Relational DBMS (RDBMS): This type of DBMS, uses a structure that allows the users to identify and
access data in relation to another piece of data in the database.
Network DBMS: This type of DBMS supports many to many relations wherein multiple member records
can be linked.
Object-oriented DBMS: This type of DBMS uses small individual software called objects. Each object
contains a piece of data, and the instructions for the actions to be done with the data.
• DDL (Data Definition Language)– It allows you to perform various operations on the database such
as CREATE, ALTER and DELETE objects.
• DML (Data Manipulation Language) – It allows you to access and manipulate data. It helps you to
insert, update, delete and retrieve data from the database.
• DCL (Data Control Language) – It allows you to control access to the database. Example – Grant or
Revoke access permissions.
9
• TCL (Transaction Control Language) – It allows you to deal with the transaction of the database.
Example – Commit, Rollback, Savepoint, Set Transaction.
Ease of Management - The software very easily gets downloaded and also uses an event scheduler to
schedule the tasks automatically.
• Robust Transactional Support – Holds the ACID (Atomicity, Consistency, Isolation, and Durability)
property, and also allows distributed multi-version support.
• Comprehensive Application Development – MySQL has plugin libraries to embed the database into
any application. It also supports stored procedures, triggers, functions, views and many more for application
development.
• High Performance – Provides fast load utilities with distinct memory caches and table index
partitioning.
• Low Total Cost of Ownership – This reduces licensing costs and hardware expenditures.
• Open Source & 24 * 7 Support – This RDBMS can be used on any platform and offers 24*7 support
for open source and enterprise edition.
• Secure Data Protection – MySQL supports powerful mechanisms to ensure that only authorized users
have access to the databases.
• High Availability – MySQL can run high-speed master/slave replication configurations and it offers
cluster servers.
• Scalability & Flexibility – With MySQL you can run deeply embedded applications and create data
warehouses holding a humongous amount of data.
• Numeric – This data type includes integers of various sizes, floating-point(real) of various precisions and
formatted numbers.
10
• Character-string – These data types either have a fixed, or a varying number of characters. This data
type also has a variable-length string called CHARACTER LARGE OBJECT(CLOB) which is used to specify
columns that have large text values.
• Bit-string – These data types are either of a fixed length or varying length of bits.
There is also a variable-length bit string data type called BINARY LARGE OBJECT(BLOB), which is
available to specify columns that have large binary values, such as images.
• Boolean –This data type has TRUE or FALSE values. Since SQL, has NULL values, a three-valued logic is
used, which is UNKNOWN.
• Date & Time –The DATE data type has: YEAR, MONTH, and DAY in the form YYYY-MM-DD.
Similarly, the TIME data type has the components HOUR, MINUTE, and SECOND in the form HH:MM: SS.
These formats can change based on the requirement.
• Timestamp & Interval –The TIMESTAMP data type includes a minimum of six positions, for decimal
fractions of seconds and an optional WITH TIME ZONE qualifier in addition to the DATE and TIME fields.
The INTERVAL data type mentions a relative value that can be used to increment or decrement an absolute
value of a date, time, or timestamp. Python MySQL Database Connection: Arguments required to connect
MySQL from Python. You need to know the following detail of the MySQL server to perform the connection
from Python.
You need to know the following detail of the MySQL server to perform the connection from Python.
• Username – i.e., the username that you use to work with MySQL Server. The default username for the
MySQL database is a root.
• Password – Password is given by the user at the time of installing the MySQL database. If you are using
root then you won’t need the password.
• Host Name – is the server’s name or Ip address on which MySQL is running. If you are running on
localhost, then you can use localhost, or its IP, i.e. 127.0.0.0
• Database Name – Database name to which you want to connect. This is an optional argument.
11
READ Operation
READ Operation on any database means to fetch some useful information from the database. Once our database
connection is established, you are ready to make a query into this database. You can use either fetchone()
method to fetch single record or fetchall()method to fetch multiple values from a database table.
• fetchone() − It fetches the next row of a query result set. A result set is an object that is returned when a
cursor object is used to query a table.
• fetchall() − It fetches all the rows in a result set. If some rows have already been extracted from the result
set, then it retrieves the remaining rows from the result set.
5.DATABASE CONNECTIVITY
Steps to connect MySQL database in Python using MySQL
Connector Python
2. Use the mysql.connector.connect()method of MySQL Connector Python with required parameters to connect
MySQL.
3. Use the connection object returned by a connect()method to create a cursor object to perform Database
Operations.
5. Close the Cursor object using a cursor.close() and MySQL database connection using connection.close() after
your work completes.
OS:
The OS module in Python provides functions for interacting with the operating system.OS comes under
Python’s standard utility modules. This module provides a portable way of using operating system-dependent
functionality. The os module include many functions to interact with the file system.
MySQL Connector:
MySQL Connector/Python enables Python programs to access MySQL databases, using an API that is
compliant with the Python Database API Specification v2
12
Platform:
The platform module in Python is quite handy for retrieving information about the system on which your
Python code is running.
FUNCTIONS USED:
7.DATABASE SCHEMA
Vehicle
Id
Plate no
Model
Colour
Owner name
Parking
Id
Vehicle_id
No_of_days
Level_of_parking
fee
13
8.MYSQL QUERIES USED IN THIS PROJECT
CREATE TABLE vehicles (
id INT PRIMARY KEY,
plate_no VARCHAR(20) NOT NULL,
model VARCHAR(50),
colour VARCHAR(20),
owner_name VARCHAR(50))
9.SOURCE CODE
import mysql.connector as mysql
def create_connection():
"""Create a database connection."""
mydb = mysql.connect(
host='localhost',
user='root',
password='murali',
database='parking_management')
print("Connected to MySQL database")
return mydb
def create_tables(mydb):
"""Create tables if they don't exist."""
cursor = mydb.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS vehicles(
id INT AUTO_INCREMENT PRIMARY KEY,
14
plate_no VARCHAR(20) NOT NULL,
model VARCHAR(50),
colour VARCHAR(20),
owner_name VARCHAR(50))''')
cursor.execute('''CREATE TABLE IF NOT EXISTS parking(
id INT AUTO_INCREMENT PRIMARY KEY,
vehicle_id INT,
no_of_days INT,
level_of_parking VARCHAR(20),
fee INT,
FOREIGN KEY (vehicle_id) REFERENCES vehicles(id))''')
mydb.commit()
def add_parking(mydb):
15
cursor = mydb.cursor()
# User inputs
vehicle_id = int(input("Enter Vehicle ID: "))
no_of_days = int(input("Enter Number of Days: "))
level_of_parking = input("Enter Level of Parking: ")
# Calculate fees
daily_rate = 100 # Set daily rate
fee = max(daily_rate, daily_rate * no_of_days)
query = "INSERT INTO parking (vehicle_id, no_of_days, level_of_parking, fee) VALUES ({}, {}, {},
{}).format(vehicle_id, no_of_days, level_of_parking, fee)
cursor.execute(query)
mydb.commit()
print("Parking information added successfully with fee: {}".format(fee))
print("\nSearch Results:")
if results:
print("ID | Plate No | Model | Colour | Owner")
print("-----------------------------------------")
for vehicle in results:
print("{} | {} | {} | {} | {}".format(vehicle[0], vehicle[1], vehicle[2], vehicle[3], vehicle[4]))
print("-----------------------------------------")
else:
print("No vehicles found.")
def display_vehicles(mydb):
cursor = mydb.cursor()
cursor.execute("SELECT * FROM vehicles")
vehicles = cursor.fetchall()
print("\nVehicles:")
print("ID | Plate No | Model | Colour | Owner")
print("-----------------------------------------")
for vehicle in vehicles:
16
print("{} | {} | {} | {} | {}".format(vehicle[0], vehicle[1], vehicle[2], vehicle[3], vehicle[4]))
print("-----------------------------------------")
def display_parking_info(mydb):
cursor = mydb.cursor()
cursor.execute('''SELECT parking.no_of_days, parking.level_of_parking, vehicles.plate_no, parking.fee
FROM parking JOIN vehicles ON parking.vehicle_id = vehicles.id''')
parking_info = cursor.fetchall()
print("\nParking Information:")
print("Plate No | No of Days | Level of Parking | Fee")
print("-----------------------------------------")
for info in parking_info:
print("{} | {} | {} | {}".format(info[2], info[0], info[1], info[3]))
print("-----------------------------------------")
def close_connection(mydb):
if mydb.is_connected():
mydb.close()
print("MySQL connection is closed.")
def main():
mydb = create_connection()
create_tables(mydb)
while True:
print("\nParking Management System")
print("1. Add Vehicle")
print("2. Update Vehicle")
print("3. Delete Vehicle")
print("4. Add Parking")
print("5. Search Vehicle")
print("6. Display Vehicles")
print("7. Display Parking Information")
print("8. Exit")
if choice == '1':
plate_no = input("Enter Plate No: ")
model = input("Enter Model: ")
colour = input("Enter Colour: ")
owner_name = input("Enter Owner Name: ")
17
add_vehicle(mydb, plate_no, model, colour, owner_name)
else:
print("Invalid option, please try again.")
if __name__ == '__main__':
main()
18
10.OUTPUT
19
20
21
22
11.CONCLUSION
A well-implemented parking management system significantly enhances the efficiency and convenience of
parking facilities. By integrating digital technologies, such systems streamline the process of finding and
reserving parking spaces, reduce congestion, and improve overall user satisfaction. Key benefits include
optimized space utilization, reduced time spent searching for parking, and enhanced data collection for better
decision-making. Ultimately, a robust parking management system not only supports smoother traffic flow but
also contributes to the economic and environmental well-being of communities.
The implementation of a parking management system using Python and MySQL in a mall or shopping complex
has proven to be a significant enhancement in managing parking resources effectively. This system addresses
common challenges faced in high-traffic areas, such as overcrowding, inefficient space utilization, and poor
user experience.
23
Key Benefits:
1. Efficiency and Convenience: The system automates the parking process, allowing users to find available
spots quickly. This not only reduces the time spent searching for parking but also decreases congestion around
the facility.
2. Real-Time Monitoring: With MySQL as the backend, the system can track real-time occupancy levels. This
data enables mall management to make informed decisions regarding space allocation and maintenance.
3. User-Friendly Interface: The system’s design prioritizes user experience, offering a straightforward interface
for both customers and management. Customers can easily reserve spots, check availability, and receive
notifications about their parking status.
4. Data Management and Reporting: Utilizing MySQL facilitates robust data storage and management, allowing
for detailed reporting on usage patterns, peak times, and revenue generation. This data is invaluable for strategic
planning and operational improvements.
5. Scalability and Flexibility: The architecture of the system allows for easy scalability. As the mall expands or
undergoes renovations, additional features or modules can be integrated without significant disruption.
6. Cost-Effectiveness: By optimizing parking space and improving operational efficiency, the system
contributes to cost savings for the mall. It can also potentially increase revenue through better utilization of
parking resources.
While the system brings numerous advantages, there are challenges to consider, such as:
- Technical Issues: Regular maintenance and updates are necessary to ensure system reliability and security.
- User Adoption: Effective training and clear communication are essential to encourage users to embrace the
new system.
- Integration with Existing Infrastructure: Careful planning is required to integrate the new system with existing
technologies and processes within the mall.
24
Future Enhancements:
- Mobile Application: Developing a mobile app to provide users with an even more convenient way to manage
their parking.
- Payment Integration: Incorporating online payment options to streamline transactions and improve user
experience.
-Advanced Analytics: Utilizing machine learning algorithms to predict parking demand and optimize space
allocation dynamically.
Final Thoughts:
The development of a parking management system using Python and MySQL in a mall setting represents a
forward-thinking solution to a common urban challenge. By leveraging technology to streamline operations,
enhance customer satisfaction, and optimize resource management, the system sets a benchmark for future
implementations in similar environments. As technology continues to evolve, ongoing improvements and
adaptations will ensure the system remains relevant and effective, ultimately contributing to a more organized
and enjoyable shopping experience.
12.BIBLIOGRAPHY
Computer science with python by sumita arora for class 12
NCERT class 12 text book
25