You are on page 1of 28

Bhonwal Convent School

Computer Science
(Python And SQL Project)
Parking Management System
Session: 2023-24

Submitted by: Submitted to:


Divyansh Raj Kureel Mr. Priyanshu Gautam
Class: XII Commerce
Certificate
This is to certify that Divyansh Raj Kureel of class XIIth of
Bhonwal Convent School has completed his project under
my supervision. He has taken proper care and shown
utmost sincerity at completion of this project.
I certify that the project is up to my expectation and as
per guidelines issued by CBSE board.

Teacher: ________________

Examiner: _______________

Principal: _______________

2|Page
Acknowledgement
I, Divyansh Raj Kureel of class XII comm., would like to
express my sincere gratitude to my computer science
teacher Mr. Priyanshu Gautam, for his vital support,
guidance and encouragement – without which this project
would not have come forth.
I would also like to express my gratitude to my school
Bhonwal Convent School for letting me use the school
laboratory.

Name: Divyansh Raj Kureel


Class: XII Commerce
Session: 2023-24
CBSE Roll no: 23717851

3|Page
Index

Sr.no Particular Remarks


1 Introduction
2 Objectives
3 Software and Hardware
Requirement
4 Limitations of the Project
5 Python. My SQL Connectivity
6 Why Python is used?
7 Flowchart
8 Database Creation
9 Source code of the project
10 Output Screening
11 Future Enhancement of the Project
12 Bibliography
13 Testing
14 Remarks

4|Page
Introduction

This is a project based on Parking Management. The


program helps us to enter, display or alter the details of
vehicles in parking records.
Moreover & most importantly the program helps us The
program also helps us to know the present status of a
parking detail, vehicle detail etc.
It includes various function programs to do the above
mentioned tasks.
Data file handling has been effectively used in the program.
The database is a collection of interrelated data to serve
multiple applications. That is database programs create
files of information. We see that the files are working with
the most, inside the program.

5|Page
Objectives
A Parking Management System (PMS) aims to efficiently
and effectively manage parking spaces, enhance the
overall parking experience, and optimize the use of
available resources. The specific objectives of a Parking
Management System may include:
1. Optimizing Space Utilization:
- Ensure efficient use of available parking spaces.
- Minimize congestion and maximize the number of
vehicles that can be accommodated.
2. Improving Accessibility:
- Enhance accessibility for all users, including individuals
with disabilities.
- Implement features such as reserved parking for people
with special needs.
3. Enhancing User Experience:
- Provide a seamless and user-friendly experience for
both parking operators and vehicle owners.
- Reduce the time and effort required for users to find
parking spaces.

6|Page
Software and Hardware Requirement

SOFTWARE SPECIFICATION:
Operating System: Windows 10
Platform: Python IDLE 3.9
Database: MySQL

HARDWARE SPECIFICATION:
Processor: Dual Core & Above
Hard Disk: 40GB
RAM: 1024MB

7|Page
Limitations Of Project
• There is a greater construction cost per space (but this
maybe offset by the chance for lesser land costs per
space and the system manufacturers say that the
operating and maintenance cost will be lower as
compared to a conventional ramped parking
structure).
• Use of redundant systems will result in a greater cost.
• It may be a bit confusing for unfamiliar users.
• It is not recommended for high peak hour volume
facilities.
• There may be a fear of breakdown (How do I get my
car out?).
• There is an uncertain building department review and
approval process.
• It requires a maintenance contract with the supplier.

8|Page
Python . My SQL Connectivity
While designing real-life applications, the data inputted by
the user along with the generated output are displayed
but not stored, since all the program execution takes place
inside the RAM, which is a temporary memory, and as
soon as we close the form, its contents get erased. They
can't be retrieved since they are not getting saved on a
hard disk. Thus, when the application is executed the
second time, it requires a new set of inputs from the user.
This limitation can be overcome by sending the output
generated and saving the input fetched from the user in a
database created at the back-end of the application. The
input is fetched from the user using Python Interface. This
is termed as the Front-end Interface of the application.

9|Page
Why Python is used?

1. Readability and Simplicity:


- Python emphasizes code readability and simplicity, making it
easy to write and understand. The language's syntax is clear and
allows developers to express concepts in fewer lines of code
compared to languages like Java or C++.
2. Versatility:
- Python is a versatile language suitable for various domains,
including web development, data science, machine learning,
artificial intelligence, scripting, automation, and more. It has a
vast ecosystem of libraries and frameworks that cater to different
needs.
3. Large Standard Library:
- Python comes with a comprehensive standard library that
provides modules and packages for a wide range of tasks. This
minimizes the need for developers to write code from scratch for
common functionalities.
5. Cross-Platform Compatibility:
- Python is a cross-platform language, meaning that Python
code can run on different operating systems with little to no
modification. This makes it easier to develop applications that
can be deployed on various platforms.

10 | P a g e
Flow Chart
Open MySQL

Create Database

Set Python and MySQL


Connection

Open Python IDLE


a

Test The Code

Exit IDLE

11 | P a g e
Database Creation
1. Create a database in MySQL named ‘parking’:
( ‘create database if not exists parking‘ )

2. CREATE TABLE parkmaster12 (


pid INT PRIMARY KEY,
pnm varchar(15) not null,
floorno int not null,
freespace int not null,
vehicleno int not null,
nod int not null,
payment int not null,
FOREIGN KEY (pid) REFERENCES parkmaster12(pid)
);
Primary Key: id is the unique identification number of an vehicle.

3. Insert records in the table parkmaster12.


sql='insert into
parkmaster12(pid,pnm,Level,freespace,vehicleno,nod,payment)values(%s,
%s,%s,%s,%s,%s,%s)'
mycursor.execute(sql,stud)
mydb.commit()

12 | P a g e
Setting the connection between Python and Database

The Python module mysql.connector has been used in this project


to establish the connection with the MySQL database in python.

Syntax:
Import mysql.connector as driver

The syntax to establish connection by providing username and


password is as follows:

mydb=daicon.connect(host="localhost",user="Danny",password="
Divyansh.12",database='parking')

if mydb.is_connected(): print(“successfully connected”)

13 | P a g e
SOURCE
CODE

14 | P a g e
Source Code Of Project
import os

import platform

import mysql.connector as daicon

mydb=daicon.connect(host="localhost", user="root", password="Divyansh.12",database='parking')

mycursor=mydb.cursor()

def Add_Record():

L=[]

id1=int(input("Enter the parking number : "))

L.append(id1)

pname1=input("Enter the Parking Name: ")

L.append(pname1)

Level1=input("Enter Level of parking : ")

L.append(Level1)

freespace1=input("Is there any freespace or not :YES/NO ")

L.append(freespace1)

vehicleno1=input("Enter the Vehicle Number : ")

L.append(vehicleno1)

nod1=int(input("Enter total number of days for parking: "))

L.append(nod1)

if nod1==1:

Payment1=20

elif nod1==2:

Payment1=40

elif nod1==3:

Payment1=60

elif nod1==4:

Payment1=80

15 | P a g e
elif nod1==5:

Payment1=100

elif nod1==6:

Payment1=6969

L.append(Payment1)

stud=(L)

sql='insert into parkmaster12(pid,pnm,Level,freespace,vehicleno,nod,payment)\

values(%s,%s,%s,%s,%s,%s,%s)'

mycursor.execute(sql,stud)

mydb.commit()

def Rec_View():

print("Select the search criteria : ")

print("1. Parking Number")

print("2. Parking Name")

print("3. Level No")

print("4. All")

ch=int(input("Enter the choice : "))

if ch==1:

s=int(input("Enter Parking no : "))

rl=(s,)

sql="select * from parkmaster12 where pid=%s"

mycursor.execute(sql,rl)

res=mycursor.fetchall()

elif ch==2:

s=input("Enter Parking Name : ")

rl=(s,)

sql="select * from parkmaster12 where pnm=%s"

mycursor.execute(sql,rl)

16 | P a g e
res=mycursor.fetchall()

elif ch==3:

s=int(input("Enter Level of Parking : "))

rl=(s,)

sql="select * from parkmaster12 where Level=%s"

mycursor.execute(sql,rl)

res=mycursor.fetchall()

elif ch==4:

sql="select * from parkmaster12"

mycursor.execute(sql)

res=mycursor.fetchall()

print("Details about Parking are as follows : ")

print("(Parking Id,Parking Name,Level,FreeSpace(Y/N),Vehicle No,No of days for parking,Payment)")

for x in res:

print(x)

print('Task comple ted')

def Vehicle_Detail():

L=[]

vid1=int(input("Enter Vehicle No : "))

L.append(vid1)

vnm1=input("Enter Vehicle Name/Model Name : ")

L.append(vnm1)

dateofpur1=input("Enter Year-Month-date of purchase : ")

L.append(dateofpur1)

vdt=(L)

sql="insert into vehicle(vid,vnm,dateofpur) values(%s,%s,%s)"

mycursor.execute(sql,vdt)

mydb.commit()

def Vehicle_View():

17 | P a g e
vid1=int(input("Enter the vehicle number of the vehicle whose details is to be viewed : "))

sql="select parkmaster12.pid,parkmaster12.pnm,parkmaster12.vehicleno, vehicle.vid,vehicle.vnm


from parkmaster12\

INNER JOIN vehicle ON parkmaster12.pid=vehicle.vid and vehicle.vid=%s"

rl=(vid1,)

print('The following are the detailes you wanted:')

mycursor.execute(sql,rl)

res=mycursor.fetchall()

for x in res:

print(x)

print('Task compelted')

def remove():

vid1=int(input("Enter the vehicle number of the vehicle to be deleted : "))

rl=(vid1,)

sql="Delete from vehicle where vid=%s"

mycursor.execute(sql,rl)

mydb.commit()

print('Removed as per the command')

def Menu():

print("Enter 1 : To Add Parking Detail")

print("Enter 2 : To View Parking Detail ")

print("Enter 3 : To Add Vehicle Detail ")

print("Enter 4 : To Remove Vehicle Record")

print("Enter 5 : To see the details of Vehicle")

input_dt = int(input("Please Select An Above Option: "))

if(input_dt== 1):

Add_Record()

elif (input_dt==2):

Rec_View()

18 | P a g e
elif (input_dt==3):

Vehicle_Detail()

elif (input_dt==4):

remove()

elif (input_dt==5):

Vehicle_View()

else:

print("Enter correct choice....")

Menu()

def runAgain():

runAgn=input('\nwant to run Again Y/n:')

while(runAgn.lower()=='y'):

if(platform.system()=='Windows'):

print(os.system('cls'))

else:

print(os.system('clear'))

Menu()

runAgn=input('\nwant to run Again Y/n:')

runAgain()

19 | P a g e
OUTPUT

20 | P a g e
Output Screening

21 | P a g e
22 | P a g e
Future Enhancement Of Project
The smart parking industry continues to evolve as an increasing number
of cities struggle with traffic congestion and inadequate parking
availability. While the deployment of sensor technologies continues to be
core to the development of smart parking, a wide variety of other
technology innovations are also enabling more adaptable systems —
including cameras, wireless communications, data analytics, induction
loops, smart parking meters, and advanced algorithms.
The future of the smart parking market is expected to be significantly
influenced by the arrival of automated vehicles (AVs). Several cities
around the world are already beginning to trial self-parking vehicles,
specialized AV parking lots, and robotic parking valets .

23 | P a g e
Testing
Testing is a crucial phase in the software development life cycle that
involves evaluating a system or application to identify errors, ensure it
meets specified requirements, and verify its functionality. Two
fundamental approaches to testing are black box testing and white box
testing.
Black Box Testing:
Definition:
Black box testing focuses on the external behavior of the software
without examining its internal code structure. Testers are concerned with
input and output, and the internal logic of the system is not considered.
Key Points:
1. No Knowledge of Internal Implementation:
- Testers perform black box testing without any knowledge of the
internal code, structure, or implementation details of the system.
2. User's Perspective:
- Test cases are designed based on the system's specifications and
requirements, considering how users interact with the software.
3. Test Inputs and Expected Outputs:
- Testers provide inputs to the system and observe the outputs. The
focus is on validating whether the system behaves as expected.
4. Functional and Non-functional Testing:
- Both functional and non-functional aspects of the system can be
tested using black box testing. Functional testing checks specific

24 | P a g e
functionalities, while non-functional testing assesses aspects like
performance or usability.
5. Types of Black Box Testing:
- Functional Testing: Validates that the software functions according to
the specified requirements.
- Non-functional Testing: Evaluates aspects such as performance,
usability, and security.
6. Advantages:
- Testers do not need to know the internal details of the code.
- Test cases are designed from the user's perspective, ensuring that the
system meets user requirements.
7. Disadvantages:
- Limited coverage of code paths, as internal logic is not considered.
- It may not uncover implementation-specific errors.
White Box Testing:
Definition:
White box testing, also known as structural or glass box testing, involves
examining the internal code structure, logic, and implementation details
of the software.
Key Points:
1. Knowledge of Internal Code:
- Testers have knowledge of the internal code, data structures, and
algorithms used in the system.
2. Code Coverage:

25 | P a g e
- The goal is to achieve high code coverage by testing various code paths,
branches, and statements within the software.
3. Test Based on Code Structure:
- Test cases are designed based on the internal code structure, with the
aim of ensuring that all code paths are executed and behave as expected.
4. Code Optimization and Security:
- White box testing can help identify areas for code optimization and
security vulnerabilities by examining the internal workings of the
application.
5. Types of White Box Testing:
-Unit Testing: Tests individual units or components of the code.
- Integration Testing: Evaluates the interaction between different
components.
- System Testing: Assesses the overall system behavior.
- Code Review and Static Analysis: Analyzes the code without executing
it.
6. Advantages:
- Comprehensive testing of internal logic and code paths.
- Identifies issues related to code optimization, security, and
implementation.
7. Disadvantages:
- Requires knowledge of the internal code, which may not be feasible
in all cases.
- Testing all possible code paths can be time-consuming.

26 | P a g e
Summary:
- Black Box Testing: Focuses on external behavior, requires no knowledge
of internal code, and validates against specified requirements.
- White Box Testing: Examines internal code structure, requires
knowledge of internal implementation, and aims for high code coverage
to ensure comprehensive testing.

Both black box and white box testing are essential for a robust testing
strategy. They complement each other, addressing different aspects of
software quality and helping ensure that the software meets both
functional and structural requirements.

27 | P a g e
Bibliography
• www.google.com
• https://pythontrends.wordpress.com
• BOOK – Python by Sumita Arora

28 | P a g e

You might also like