0% found this document useful (0 votes)
2 views

Copy of Computer-Project (2) (1)

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)
2 views

Copy of Computer-Project (2) (1)

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/ 21

PYTHON PROJECT

PARKING MANAGEMENT SYSTEM

This Photo by Unknown Author is licensed under CC BY

SUBMITTED BY- Bharath R

1 | Page
INDEX

Sr. No Particular Page No.

1 acknownledgment 3

2 About the project 4,5

3 Flow chart 6

4 Source code 7,8,9,10,11,


12
5 Output screens 13,14,15

6 references 17

2 | Page
Acknowledgement

I would like to express my sincere gratitude to our esteemed


Principal, Smt. Mini K, and the entire staff of Bhavans Vidya
Mandir, Elamakkara, for their continuous encouragement and
support throughout the duration of this project. The invaluable
guidance, leadership, and inspiration provided by the Principal
nd the staff have been crucial to the successful completion of
this work.
I am especially thankful to my Computer Science teacher, Smt.
Bindu TC, for her unwavering support, expert guidance, and
constant encouragement. Her dedication, insightful feedback,
and commitment to teaching have played a significant role in
the successful completion of this project.
I would also like to express my heartfelt thanks to my school,
Bhavans Vidya Mandir, Elamakkara, for providing the
necessary resources, infrastructure, and facilities that made this
project possible. The support and access to technology have
significantly contributed to my learning experience and enabled
me to work efficiently on this project.
Additionally, I am grateful to my classmates, friends, and family
for their understanding, support, and encouragement
throughout this process. Without their help, this project would
not have been possible.
Thank you all for being an integral part of this journey.

3 | Page
About The Project

The Parking Management System is a Python-based


application that manages parking spots and vehicle
records using a MySQL database. The system allows users
to:

● Add Parking Details: Input parking spot information,


including number, name, level, availability, vehicle
number, and parking duration.

● View Parking Details: Search and view parking


records based on parking number, name, or level.

● Add Vehicle Details: Link a vehicle to a parking spot


by entering vehicle number, model name, and
purchase date.

● View Vehicle Details: Retrieve vehicle information and


its associated parking spot.

● Remove Vehicle Record: Delete vehicle records when


a vehicle leaves, freeing up the parking spot.

● Payment Calculation: Calculate parking fees based on


the number of days a vehicle is parked.

Key Features:

● Database Integration: Stores parking and vehicle


information in a MySQL database.

4 | Page
● Dynamic Fee Calculation: Automatically calculates
parking fees based on the number of days

5 | Page
● Simple Menu Interface: Provides an easy-to-use, text-
based menu for interacting with the system.

Technologies Used:

● Programming Language: Python

● Database: MySQL

● Libraries: mysql.connector, os, platform

Database Structure:

● parkmaster12: Stores parking spot details (ID, name,


level, space availability, payment).

● vehicle: Stores vehicle details linked to parking spots


(vehicle number, model, purchase date).

Use Case:

A parking lot manager can use this system to add parking


spot details, assign vehicles to spots, calculate parking
fees, and remove vehicle records when they leave.

Potential Improvements:

● Add user authentication.

● Implement dynamic pricing based on parking levels or


time.

● Create a GUI interface for easier interaction.

6 | Page
Flow Chart

7 | Page
Source Code Of Project
import os

import platform

import mysql.connector

mydb = mysql.connector.connect(host="localhost", user="root",


password="2007@bharath", 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: ")

8 | Page
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

elif nod1 == 5:

Payment1 = 100

elif nod1 == 6:

Payment1 = 120

9 | Page
else:

Payment1 = 120 + (nod1 - 6) * 20 # Additional days cost

L.append(Payment1)

stud = tuple(L)

sql = 'insert into parkmaster12(pid, pnm, level, freespace, vehicleno,nod,

nod, payment) values(%s, %s, %s, %s, %s, %s, %s)'

try:

mycursor.execute(sql, stud)

mydb.commit()

print("Record added successfully!")

except mysql.connector.Error as err:

print(f"Error: {err}")

def Rec_View():

print("Select the search criteria : ")

print("1. Parking Number")

print("2. Parking Name")

print("3. Level No")

print("4. All")

10 | Page
ch = int(input("Enter the choice : "))

try:

if ch == 1:

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

rl = (s,)

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

mycursor.execute(sql, rl)

elif ch == 2:

s = input("Enter Parking Name : ")

rl = (s,)

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

mycursor.execute(sql, rl)

elif ch == 3:

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

rl = (s,)

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

mycursor.execute(sql, rl)

elif ch == 4:

sql = "select * from parkmaster12"

mycursor.execute(sql)

else:

11 | Page
print("Invalid choice!")

return

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)

except mysql.connector.Error as err:

print(f"Error: {err}")

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 = tuple(L)

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

12 | Page
try:

mycursor.execute(sql, vdt)

mydb.commit()

print("Vehicle detail added successfully!")

except mysql.connector.Error as err:

print(f"Error: {err}")

def Vehicle_View():

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.pid, vehicle.vnm from

parkmaster12 INNER JOIN vehicle ON parkmaster12.pid =

vehicle.pid and vehicle.pid = %s'

rl = (vid1,)

try:

mycursor.execute(sql, rl)

res = mycursor.fetchall()

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

for x in res:

13 | Page
print(x)

except mysql.connector.Error as err:

print(f"Error: {err}")

def remove():

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

rl = (vid1,)

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

try:

mycursor.execute(sql, rl)

mydb.commit()

print('Removed successfully!')

except mysql.connector.Error as err:

print(f"Error: {err}")

def Menu():

while True:

print("\nMenu:")

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

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

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

14 | Page
print("Enter 4 : To Remove Vehicle Record")

print("Enter 5 : To See the Details of Vehicle")

print("Enter 6 : Exit")

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

if input_dt == 1:

Add_Record()

elif input_dt == 2:

Rec_View()

elif input_dt == 3:

Vehicle_Detail()

elif input_dt == 4:

remove()

elif input_dt == 5:

Vehicle_View()

elif input_dt == 6:

print("Exiting the program. Goodbye!")

break

else:

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

def runAgain():

15 | Page
while True:

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

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

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

os.system('cls')

else:

os.system('clear')

Menu()

else:

print("Exiting program.")

break

Menu()

runAgain()

16 | Page
Output Screening

17 | Page
18 | Page
19 | Page
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.These can significantly improve the
functionality, scalability, and usability of your parking
management system. They can help automate processes,
increase user engagement, and improve efficiency,
especially in larger parking facilities.

You can prioritize the features based on the specific needs


of your users and the available resources, ensuring that
the project grows in a sustainable and meaningful way.

20 | Page
references
www.google.com

https://pythontrends.wordpress.com

BOOK – Python by Sumita Arora

 Computer Science with Python


Class XII – Preeti Arora
 Computer Science with Python
Class XII – Sumita Arora
 www.geeksforgeeks.org
 www.w3schools.com/python

21 | Page

You might also like