You are on page 1of 83

A Project Report On

“SMART PARKING SYSTEM”


Submitted in partial fulfilment of the Requirements for the award of the
Degree of
BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY)

Submitted by
Shubham Dubey
SEAT NUMBER: 4022843
Under the esteemed guidance of:
Prof. Jairam Mulchanadani
Assistant Professor

DEPARTMENT OF INFORMATION TECHNOLOGY


SEVA SADAN’s R. K. Talreja College of
Arts, Science and Commerce,
Ulhasnagar-421 003
(Affiliated to University of Mumbai)
A.C. 2022-2023
SMART PARKING SYSTEM
Seva Sadan's R.K.Talreja College of Arts, Science &Commerce
(Affiliated to University of Mumbai)
Maharashtra, Ulhasnagar - 421003

DEPARTMENT OF INFORMATION TECHNOLOGY

CERTIFICATE

This is to certify that the project entitled, "SMART PARKING SYSTEM", is bonafied
work of Shubham Dubey bearing Seat. No: 4022843 submitted in partial fulfilment of the
requirements for the award of degree of BACHELOR OF SCIENCE in INFORMATION
TECHNOLOGY from University of Mumbai.

Internal Guide Head, Department of CS/IT Coordinator

External Examiner

Date: College Seal


Abstract

This project is insight into the design and implementation of a Smart


Parking System. The primary aim of is to improve accuracy and enhance
safety and efficiency in the pharmaceutical store. Today management is
one of the most essential features of all form. Management provides
sophistication to perform any kind of task in a particular form. This is
pharmacy management system; it is used to manage most pharmacy
related activities in the pharmacy.
ACKNOWLEDGEMENT

We are pleased to present our project “Smart Parking System” and takes
this opportunity to express our gratitude to all those people who helped us
in completion of this project.

We thank our college for providing us with excellent facilities that helped
us to complete and present this project. We should also like to thank the
staff members and lab assistants for permitting us to use computers in the
lab as and when requires.

I am equally grateful to my project guide Prof. Jairam Mulchanadani


and advisor and Head of Department Prof. Laxmi jeswani, for guided us
in solving problems related to your topic.

We express gratitude towards our project Guide for giving Mr. Jairam
Mulchanadani us yourvaluable time and advice during the various
phases in our project. We would also Like to thank her for providing us
with all the proper facilities and support as the project coordinator.

Finally, we would like to thank everyone who has helped us directly or


indirectly inour project.

.
DECLARATION

I hereby declare that the project entitled “Pharmacy Smart Parking System” done at
“Ulhasnagar” has not been in any case duplicated to submit to any other university for the
award of any degree. To the best of my knowledge other than me, no one has submitted to
any other university.

The project is done in partial fulfilment of the requirements for the award of degree of
BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY) to be submitted as
final semester project as part of curriculum.

Name: Shubham Dubey

Signature:
Parking Management System

Content Table

Sr.no Title Page


1 Introduction 6
2 Main Report 8-13
Chapter2 Survey of technology 9
2.2 Definition of Problem 10
Chapter3 System Requirement Phase 11
2.3.1 System Requirements 13
2.4 System Analysis Phase 14-15
2.4.1 Information Gathering 15
Chapter4 System design 16-21
2.5.1 ER DIAGRAM 17
2.5.2 DATA FLOW DIAGRAM 19
USE CASE DIAGRAM 20
CLASS DIAGRAM ACTTIVITY DIAGRAM 22-30
IMPLEMENTION AND TEST 23
CODING AND DETAIL 26
TESTING APPROACHES 27

CHAPTER
5 29
CHAPTER
6 RESULT AND DISCUSSION 31-40
2.7.1 Cost Benefits Analysis & Economic Feasibilities 32
2.7.2 User Interface 34
2.7.3 Database Snaps 39
CHAPTER
7 CONCLUSION 41
2.9 FUTURE ENHANCEMENT 44

Page | 1
Parking Management System

Page | 2
Parking Management System

CHAPTER1: INTRODUCTION

Page | 3
Parking Management System

CHAPTER1: Introduction

Parking management system for managing the records of the incoming and outgoing
vehicles in an parking house

It’s an easy for Admin to retrieve the data if the vehicle has been visited through number
he can get that data .

Now days in many public places such as malls, multiplex system, hospitals, offices,
market areas there is a crucial problem of vehicle parking. The vehicle parking area has
many lanes/slots for car parking. So to park a vehicle one has to look for all the lanes.
Moreover this involves a lot of manual labour and investment. Instead of vehicle caught
in towing the vehicle can park on safe and security with low cost.

Parking control system has been generated in such a way that it is filled with many
secure devices such as, parking control gates, toll gates, time and attendance machine,
car counting system etc. These features are hereby very necessary nowadays to secure
your car and also to evaluate the fee structure for every vehicles entry and exit

The objective of this project is to build a Vehicle Parking management system that
enables the time management and control of vehicles using number plate recognition.
The system that will track the entry and exit of cars, maintain a listing of cars within the
parking lot, and determine if the parking lot is full or not. It will determine the cost of per
vehicle according to their time consumption.

Page | 4
Parking Management System

CHAPTER 2: SURVEY AND TECHNOLOGY

Page | 5
Parking Management System

CHAPTER 2: SURVEY AND TECHNOLOGY


We can park our vehicle in our own slot by paying.

• Because of that there is no towing problems.


• And our vehicle has been parked as a secure condition.
• There is no risk for vehicle owner for parking the car.
• In case of any damages and problem of vehicle that will claim by parking
management.
• As the world is facing many threads daily, robberies are done easily with no track
to trace, bomb blasts occur with the use of vehicle, so if a proper system is
adopted each and every record can be saved and anyone can be track easily
therefore mainly is to make a better and fast software, most important user-
friendly
• Maintain records in short time of period.
• Determines the parking area is full or not.
• Enhances the visitor’s experience.

Scope:
In the modern age. Many people have vehicles. Vehicle is now a basic need. Every
place is under the process of urbanization. There are many corporate offices and
shopping centers etc. There are many recreational places where people used to go for
refreshment. So, all these places need a parking space where people can park their
vehicles safely and easily. Every parking area needs a system that records the detail of
vehicles to give the facility. These systems might be computerized or non-computerized.
With the help of computerized system we can deliver a good service to customer who
wants to park their vehicle into the any organization’s premises.

Vehicle parking management system is an automatic system which delivers data


processing in very high speed in systematic manner. Parking is a growing need of the
time. Development of this system is very useful in this area of field. We can sell this
system to any organization. By using our system they can maintain records very easily.
Our system covers the every area of parking management. In coming future there will
be excessive need of Vehicle parking management system.

Page | 6
Parking Management System

2.2 Definition of problem:


• Now a days in parking like valet parking they maintain just with the tokens and
they have records the vehicle details in books so that during some critical
situations like police enquiry of terrorist car or vehicle roberrer that case it is
difficult to find the details of particular vehicle but in this case is easy to find in 1
to 2 seconds
• By parking the vehicle in public place the vehicle can be claimed by towing
person but in this case there is no towing problems and no need to give fine for
anything we can park our vehicle with securely.

Page | 7
Parking Management System

CHAPTER 3: REQUIREMENT SYSTEM AND ANALYSIS

Page | 8
Parking Management System

CHAPTER 3 : REQURIEMENTS SYSTEM ANALYSIS

2.3 SYSTEM REQUIREMENT PHASE


1. Project Title :
Smart Parking System

2. Technology:

Front End: python

Python has become one of the most popular programming

languages in the world in recent years. It's used in


everything from machine learning to building websites and
software testing. It can be used by developers and non-
developers alike. Python, one of the most popular
programming languages in the world, has created everything
from Netflix’s recommendation algorithm to the software
that controls self-driving cars. Python is a general-purpose
language, which means it’s designed to be used in a range of
applications, including data science, software and web
development, automation, and generally getting stuff done.

Back End: SQL server lite
Microsoft SQL Server is a relational database management system developed
by Microsoft. As a database server, it is a software product with the primary
function of storing and retrieving data as requested by other software
applications—which may run either on the same computer or on another
computer across a network (including the Internet).

Page | 9
Parking Management System

Microsoft markets at least a dozen different editions of Microsoft SQL Server,


aimed at different audiences and for workloads ranging from small single-
machine applications to large Internet-facing applications with many concurrent
users

3. Modules
a).Data Records
Staff records: - It helps to provide details of staff that uses the Vehicle parking
management System. It provides the descriptions of staffs like:
-Staff first, middle and last name
-Address
-Contact Number
-Gender.

User Records: - This record helps for the authorization for using Vehicle
Parking Management System. It Provides the Username and Password for the User
(staff).It also includes the level of authority that means it separates the normal users
and administrator.

Vehicle Records: - This most important record which focuses in our Vehicle
Parking Management System. It stores the essential Vehicle records like:
-Vehicle Number
-Vehicle Type
-Vehicle Entry Time
-Vehicle Exit Time

b).Reports
Vehicle Parking Detail: - This report is very essential in this system. This
report provides a brief summary of vehicle activities. It shows the overall Entry and Exit
time. It shows the User at time of Entry and Exit .It also provides the facility for
examining the total vehicle details according to date wise.

Page | 10
Parking Management System

Transaction Detail:-This report will show the Transaction between the


customer and the System. . It shows the cost of the vehicle after using the facility of
parking. It will show the number of transaction by date wise. It will also have User at
time of the Transaction.

2.3.1 Hardware and software requirement

PROCESSOR TYPE Pentium IV or above for optimum performance.

SYSTEM RAM 1.00GB and Above

INPUT DEVICE BASIC KEYBOARD AND TOUCH PAD

OUTPUT DEVICE STANDARD COLOR MONITOR

OPERATING WINDOWS 7,8,10


SYSTEM

FRONT END python

BACK END SQL SERVER lite

Page | 11
Parking Management System

CHAPTER 4: SYSTEM AND DESIGN

Page | 12
Parking Management System

2.6.1 Data Flow Diagram:

Level 0 :

Page | 13
Parking Management System

Level 1:

Page | 14
Parking Management System

Level 2:

Page | 15
Parking Management System

2.6.2 ER-Diagram

Page | 16
Parking Management System

2.6.3 Class diagram

Page | 17
Parking Management System

2.6.4 Use case Diagram

System

Display parking space availability


Display

Insert Vehicle_no
System Configuration

<<include>>

Generate Report
Insert Vehicle_name

Manage member <<include>>

<<include>>
Insert owner_name
Admin Insert the details of vehicle
<<include>>

Transaction Details
Insert_Intime
<<include>>

Print Transaction details

Insert_Outtime

Pay's Money

Customer

Space Availability

Page | 18
Parking Management System

2.6.5 Activity Diagram

Administrator System

Login [Username and password] Check Login Password

[Module List] Display Module List Display Error Message

Select Module Prompt input details

Insert Customer Details

[Save] Save Details

Open Details

Prepare Transaction details Generate Report

Generate Bill

Thank You

Page | 19
Parking Management System

2.6.6 Sequence diagram

User Admin Database Parking slot

1 : Register request()

2 : Register sucessful()

3 : Login request()

4 : Login succesful()
5 : Vehicle arrives()

6 : Provide details()

7 : Enter details()

8 : Save to database()

9 : check availability()

10 : Parks the vehicle()


11 : Provide details()

12 : Enter details()

13 : save to database()

14 : Request details()

15 : Retrive details()

16 : Generate report()

17 : Gives receipt()

Page | 20
Parking Management System

CHAPTER 5: IMPLEMENTATION AND TESTING

2.7.1 Cost Benefit Analysis:

Page | 21
Parking Management System

Cost benefit analysis (CBA) estimates and total up the equivalent money value of the
benefits and the cost invested to for implementation the software .Cost benefit analysis
(CBA) is the weighing scale approach to decision-making. All the plus points (such as
cash flow and other intangible benefits) are put on one side all the minus points (the
cost and disadvantages) are put on the other side. Both sides should be weighed and
benefits should be evaluated.

Cost Estimation:
A cost estimate is the approximation of the cost of a program, project, or operation.
The cost estimate is the product of the cost estimating process. The cost estimate
has a single total value and may have identifiable component values.

For a given set of requirements, it is desirable to know how much it will cost to develop
the software to satisfy a given requirement, and how much time development will take.
The cost of a project is a function of many parameters. Foremost among them is the
size of the project. Other factors that effects the cost are programmer ability, experience
of the developers in the area , complexity of the project, and reliability requirements of
the software, hardware and human resources

Benefits:
• Improves business processes leading to annual cost decrease.
• Due to availability of information, better decision making is possible leading to
additional cash flows.

Page | 22
Parking Management System

This is the Django template system.

How it works:

The Lexer.tokenize() method converts a template string (i.e., a string

containing markup with custom template tags) to tokens, which can be either

plain text (TokenType.TEXT), variables (TokenType.VAR), or block

statements (TokenType.BLOCK).

The Parser() class takes a list of tokens in its constructor, and its parse()

method returns a compiled template -- which is, under the hood, a list of

Node objects.

Each Node is responsible for creating some sort of output -- e.g. simple text

(TextNode), variable values in a given context (VariableNode), results of basic

logic (IfNode), results of looping (ForNode), or anything else. The core Node

types are TextNode, VariableNode, IfNode and ForNode, but plugin modules can

define their own custom node types.

Each Node has a render() method, which takes a Context and returns a string of

the rendered node. For example, the render() method of a Variable Node returns

the variable's value as a string. The render() method of a ForNode returns the

rendered output of whatever was inside the loop, recursively.

Page | 23
Parking Management System

The Template class is a convenient wrapper that takes care of

template compilation and rendering.

Usage:

The only thing you should ever use directly in this file is the Template

class. Create a compiled template object with a template_string, then call

render() with a context. In the compilation stage, the TemplateSyntaxError

exception will be raised if the template doesn't have proper syntax.

Sample code:

>>> from django import template

>>> s = '<html>{% if test %}<h1>{{ varvalue }}</h1>{% endif %}</html>'

>>> t = template.Template(s)

(t is now a compiled template, and its render() method can be called

multiple times with multiple contexts)

>>> c = template.Context({'test':True, 'varvalue': 'Hello'})

>>> t.render(c)

'<html><h1>Hello</h1></html>'

>>> c = template.Context({'test':False, 'varvalue': 'Hello'})

>>> t.render(c)

Page | 24
Parking Management System

'<html></html>'

"""

import inspect

import logging

import re

from enum import Enum

from django.template.context import BaseContext

from django.utils.formats import localize

from django.utils.html import conditional_escape, escape

from django.utils.regex_helper import _lazy_re_compile

from django.utils.safestring import SafeData, mark_safe

from django.utils.text import (

get_text_list, smart_split, unescape_string_literal,

from django.utils.timezone import template_localtime

from django.utils.translation import gettext_lazy, pgettext_lazy

from .exceptions import TemplateSyntaxError

# template syntax constants

FILTER_SEPARATOR = '|'

FILTER_ARGUMENT_SEPARATOR = ':'

VARIABLE_ATTRIBUTE_SEPARATOR = '.'

Page | 25
Parking Management System

BLOCK_TAG_START = '{%'

BLOCK_TAG_END = '%}'

VARIABLE_TAG_START = '{{'

VARIABLE_TAG_END = '}}'

COMMENT_TAG_START = '{#'

COMMENT_TAG_END = '#}'

TRANSLATOR_COMMENT_MARK = 'Translators'

SINGLE_BRACE_START = '{'

SINGLE_BRACE_END = '}'

# what to report as the origin for templates that come from non-loader sources

# (e.g. strings)

UNKNOWN_SOURCE = '<unknown source>'

# match a variable or block tag and capture the entire tag, including start/end

# delimiters

tag_re = (_lazy_re_compile('(%s.?%s|%s.?%s|%s.*?%s)' %

(re.escape(BLOCK_TAG_START), re.escape(BLOCK_TAG_END),

re.escape(VARIABLE_TAG_START), re.escape(VARIABLE_TAG_END),

re.escape(COMMENT_TAG_START), re.escape(COMMENT_TAG_END))))

logger = logging.getLogger('django.template')

class TokenType(Enum):

Page | 26
Parking Management System

TEXT = 0

VAR=1

BLOCK = 2

COMMENT = 3

class VariableDoesNotExist(Exception):

def _init_(self, msg, params=()):

self.msg = msg

self.params = params

def _str_(self):

return self.msg % self.params

class Origin:

def _init_(self, name, template_name=None, loader=None):

self.name = name

self.template_name = template_name

self.loader = loader

def _str_(self):

return self.name

Page | 27
Parking Management System

def _eq_(self, other):

return (

isinstance(other, Origin) and

self.name == other.name and

self.loader == other.loader

@property

def loader_name(self):

if self.loader:

return '%s.%s' % (

self.loader._module, self.loader.class.name_,

class Template:

def _init_(self, template_string, origin=None, name=None, engine=None):

# If Template is instantiated directly rather than from an Engine and

# exactly one Django template engine is configured, use that engine.

# This is required to preserve backwards-compatibility for direct use

# e.g. Template('...').render(Context({...}))

if engine is None:

from .engine import Engine

engine = Engine.get_default()

if origin is None:

Page | 28
Parking Management System

origin = Origin(UNKNOWN_SOURCE)

self.name = name

self.origin = origin

self.engine = engine

self.source = str(template_string) # May be lazy.

self.nodelist = self.compile_nodelist()

def _iter_(self):

for node in self.nodelist:

yield from node

def _render(self, context):

return self.nodelist.render(context)

def render(self, context):

"Display stage -- can be called many times"

with context.render_context.push_state(self):

if context.template is None:

with context.bind_template(self):

context.template_name = self.name

return self._render(context)

else:

return self._render(context)

def compile_nodelist(self):

Page | 29
Parking Management System

"""

Parse and compile the template source into a nodelist. If debug

is True and an exception occurs during parsing, the exception is

annotated with contextual line information where it occurred in the

template source.

"""

if self.engine.debug:

lexer = DebugLexer(self.source)

else:

lexer = Lexer(self.source)

tokens = lexer.tokenize()

parser = Parser(

tokens, self.engine.template_libraries, self.engine.template_builtins,

self.origin,

try:

return parser.parse()

except Exception as e:

if self.engine.debug:

e.template_debug = self.get_exception_info(e, e.token)

raise

def get_exception_info(self, exception, token):

Page | 30
Parking Management System

"""

Return a dictionary containing contextual line information of where

the exception occurred in the template. The following information

is provided:

message

The message of the exception raised.

source_lines

The lines before, after, and including the line the

exception occurred on.

line

The line number the exception occurred on.

before, during, after

The line the exception occurred on split into three parts:

1. The content before the token that raised the error.

2. The token that raised the error.

3. The content after the token that raised the error.

total

The number of lines in source_lines.

top

Page | 31
Parking Management System

The line number where source_lines starts.

bottom

The line number where source_lines ends.

start

The start position of the token in the template source.

end

The end position of the token in the template source.

"""

start, end = token.position

context_lines = 10

line = 0

upto = 0

source_lines = []

before = during = after = ""

for num, next in enumerate(linebreak_iter(self.source)):

if start >= upto and end <= next:

line = num

before = escape(self.source[upto:start])

during = escape(self.source[start:end])

after = escape(self.source[end:next])

source_lines.append((num, escape(self.source[upto:next])))

upto = next

Page | 32
Parking Management System

total = len(source_lines)

top = max(1, line - context_lines)

bottom = min(total, line + 1 + context_lines)

# In some rare cases exc_value.args can be empty or an invalid

# string.

try:

message = str(exception.args[0])

except (IndexError, UnicodeDecodeError):

message = '(Could not get exception message)'

return {

'message': message,

'source_lines': source_lines[top:bottom],

'before': before,

'during': during,

'after': after,

'top': top,

'bottom': bottom,

'total': total,

'line': line,

'name': self.origin.name,

'start': start,

'end': end,

Page | 33
Parking Management System

def linebreak_iter(template_source):

yield 0

p = template_source.find('\n')

while p >= 0:

yield p + 1

p = template_source.find('\n', p + 1)

yield len(template_source) + 1

class Token:

def _init_(self, token_type, contents, position=None, lineno=None):

"""

A token representing a string from the template.

token_type

A TokenType, either .TEXT, .VAR, .BLOCK, or .COMMENT.

contents

The token source string.

position

An optional tuple containing the start and end index of the token

Page | 34
Parking Management System

in the template source. This is used for traceback information

when debug is on.

lineno

The line number the token appears on in the template source.

This is used for traceback information and gettext files.

"""

self.token_type, self.contents = token_type, contents

self.lineno = lineno

self.position = position

def _str_(self):

token_name = self.token_type.name.capitalize()

return ('<%s token: "%s...">' %

(token_name, self.contents[:20].replace('\n', '')))

def split_contents(self):

split = []

bits = smart_split(self.contents)

for bit in bits:

# Handle translation-marked template pieces

if bit.startswith(('("', "('")):

sentinel = bit[2] +

')' trans_bit = [bit]

while not bit.endswith(sentinel):

Page | 35
Parking Management System

bit = next(bits)

trans_bit.append(bit)

bit = ' '.join(trans_bit)

split.append(bit)

return split

class Lexer:

def _init_(self, template_string):

self.template_string = template_string

self.verbatim = False

def tokenize(self):

"""

Return a list of tokens from a given template_string.

"""

in_tag = False

lineno = 1

result = []

for bit in tag_re.split(self.template_string):

if bit:

result.append(self.create_token(bit, None, lineno, in_tag))

in_tag = not in_tag

lineno += bit.count('\n')

return result

Page | 36
Parking Management System

def create_token(self, token_string, position, lineno, in_tag):

"""

Convert the given token string into a new Token object and return

it. If in_tag is True, we are processing something that matched a

tag, otherwise it should be treated as a literal string. """

if in_tag and token_string.startswith(BLOCK_TAG_START):

# The [2:-2] ranges below strip off *_TAG_START and *_TAG_END.

# We could do len(BLOCK_TAG_START) to be more "correct", but we've

# hard-coded the 2s here for performance. And it's not like

# the TAG_START values are going to change anytime, anyway.

block_content = token_string[2:-2].strip()

if self.verbatim and block_content == self.verbatim:

self.verbatim = False

if in_tag and not self.verbatim:

if token_string.startswith(VARIABLE_TAG_START):

return Token(TokenType.VAR, token_string[2:-2].strip(), position, lineno)

elif token_string.startswith(BLOCK_TAG_START):

if block_content[:9] in ('verbatim', 'verbatim '):

self.verbatim = 'end%s' % block_content

return Token(TokenType.BLOCK, block_content, position, lineno)

elif token_string.startswith(COMMENT_TAG_START):

content = ''

if token_string.find(TRANSLATOR_COMMENT_MARK):

Page | 37
Parking Management System

content = token_string[2:-2].strip()

return Token(TokenType.COMMENT, content, position, lineno)

else:

return Token(TokenType.TEXT, token_string, position, lineno)

class DebugLexer(Lexer):

def tokenize(self):

"""

Split a template string into tokens and annotates each token with

its start and end position in the source. This is slower than the

default lexer so only use it when debug is True. """

lineno = 1

result = []

upto = 0

for match in tag_re.finditer(self.template_string):

start, end = match.span()

if start > upto:

token_string = self.template_string[upto:start]

result.append(self.create_token(token_string, (upto, start), lineno,


in_tag=False))

lineno += token_string.count('\n')

token_string = self.template_string[start:end]

result.append(self.create_token(token_string, (start, end), lineno,


in_tag=True))

Page | 38
Parking Management System

lineno += token_string.count('\n')

upto = end

last_bit = self.template_string[upto:]

if last_bit:

result.append(self.create_token(last_bit, (upto, upto + len(last_bit)), lineno,


in_tag=False))

return result

class Parser:

def _init_(self, tokens, libraries=None, builtins=None, origin=None):

# Reverse the tokens so delete_first_token(), prepend_token(), and

# next_token() can operate at the end of the list in constant

time. self.tokens = list(reversed(tokens))

self.tags = {} self.filters =

{} self.command_stack =

[]

if libraries is None:

libraries = {}

if builtins is None:

builtins = []

self.libraries = libraries

for builtin in builtins:

Page | 39
Parking Management System

self.add_library(builtin)

self.origin = origin

def parse(self, parse_until=None):

"""

Iterate through the parser tokens and compiles each one into a node.

If parse_until is provided, parsing will stop once one of the

specified tokens has been reached. This is formatted as a list

of tokens, e.g. ['elif', 'else', 'endif']. If no matching token is

reached, raise an exception with the unclosed block tag details.

"""

if parse_until is None:

parse_until = []

nodelist = NodeList()

while self.tokens:

token = self.next_token()

# Use the raw values here for TokenType.* for a tiny performance

boost. if token.token_type.value == 0: # TokenType.TEXT

self.extend_nodelist(nodelist, TextNode(token.contents),

token) elif token.token_type.value == 1: # TokenType.VAR

if not token.contents:

raise self.error(token, 'Empty variable tag on line %d' %

token.lineno) try:

filter_expression = self.compile_filter(token.contents)

Page | 40
Parking Management System

except TemplateSyntaxError as e:

raise self.error(token, e)

var_node = VariableNode(filter_expression)

self.extend_nodelist(nodelist, var_node, token)

elif token.token_type.value == 2: # TokenType.BLOCK

try:

command = token.contents.split()[0]

except IndexError:

raise self.error(token, 'Empty block tag on line %d' % token.lineno)

if command in parse_until:

# A matching token has been reached. Return control to

# the caller. Put the token back on the token list so the

# caller knows where it terminated.

self.prepend_token(token)

return nodelist

# Add the token to the command stack. This is used for error

# messages if further parsing fails due to an unclosed block

# tag.

self.command_stack.append((command, token))

# Get the tag callback function from the ones registered with

# the parser.

try:

compile_func = self.tags[command]

except KeyError:

self.invalid_block_tag(token, command, parse_until)

Page | 41
Parking Management System

# Compile the callback into a node object and add it to

# the node list.

try:

compiled_result = compile_func(self, token)

except Exception as e:

raise self.error(token, e)

self.extend_nodelist(nodelist, compiled_result, token)

# Compile success. Remove the token from the command stack.

self.command_stack.pop()

if parse_until:

self.unclosed_block_tag(parse_until)

return nodelist

def skip_past(self, endtag):

while self.tokens:

token = self.next_token()

if token.token_type == TokenType.BLOCK and token.contents == endtag:

return

self.unclosed_block_tag([endtag])

def extend_nodelist(self, nodelist, node, token):

# Check that non-text nodes don't appear before an extends

tag. if node.must_be_first and nodelist.contains_nontext:

raise self.error(

token, '%r must be the first tag in the template.' % node,

Page | 42
Parking Management System

if isinstance(nodelist, NodeList) and not isinstance(node, TextNode):

nodelist.contains_nontext = True

# Set origin and token here since we can't modify the node _init_()

# method.

node.token = token

node.origin = self.origin

nodelist.append(node)

def error(self, token, e):

"""

Return an exception annotated with the originating token. Since the

parser can be called recursively, check if a token is already set.

This ensures the innermost token is highlighted if an exception

occurs, e.g. a compile error within the body of an if statement. """

if not isinstance(e, Exception):

e = TemplateSyntaxError(e)

if not hasattr(e, 'token'):

e.token = token

return e

def invalid_block_tag(self, token, command, parse_until=None):

if parse_until:

raise self.error(

Page | 43
Parking Management System

token,

"Invalid block tag on line %d: '%s', expected %s. Did you "

"forget to register or load this tag?" % (

token.lineno,

command,

get_text_list(["'%s'" % p for p in parse_until], 'or'),

),

raise self.error(

token,

"Invalid block tag on line %d: '%s'. Did you forget to register "

"or load this tag?" % (token.lineno, command)

def unclosed_block_tag(self, parse_until):

command, token = self.command_stack.pop()

msg = "Unclosed tag on line %d: '%s'. Looking for one of: %s." % (

token.lineno,

command,

', '.join(parse_until),

raise self.error(token, msg)

def next_token(self):

return self.tokens.pop()

Page | 44
Parking Management System

def prepend_token(self, token):

self.tokens.append(token)

def delete_first_token(self):

del self.tokens[-1]

def add_library(self, lib):

self.tags.update(lib.tags)

self.filters.update(lib.filters)

def compile_filter(self, token):

"""

Convenient wrapper for FilterExpression

"""

return FilterExpression(token, self)

def find_filter(self, filter_name):

if filter_name in self.filters:

return self.filters[filter_name]

else:

raise TemplateSyntaxError("Invalid filter: '%s'" % filter_name)

# This only matches constant strings (things in quotes or marked for

Page | 45
Parking Management System

# translation). Numbers are treated as variables for implementation reasons

# (so that they retain their type when passed to filters).

constant_string = r"""

(?:%(i18n_open)s%(strdq)s%(i18n_close)s|

%(i18n_open)s%(strsq)s%(i18n_close)s|

%(strdq)s|

%(strsq)s)

"""%{

'strdq': r'"[^"\\](?:\\.[^"\\])*"', # double-quoted string

'strsq': r"'[^'\\](?:\\.[^'\\])*'", # single-quoted string

'i18n_open': re.escape("_("),

'i18n_close': re.escape(")"),

constant_string = constant_string.replace("\n", "")

filter_raw_string = r"""

^(?P<constant>%(constant)s)|

^(?P<var>[%(var_chars)s]+|%(num)s)|

(?:\s*%(filter_sep)s\s*

(?P<filter_name>\w+)

(?:%(arg_sep)s

(?:

(?P<constant_arg>%(constant)s)|

(?P<var_arg>[%(var_chars)s]+|%(num)s)

Page | 46
Parking Management System

)?

)""" % {

'constant': constant_string,

'num': r'[-+\.]?\d[\d\.e]*',

'var_chars': r'\w\.',

'filter_sep': re.escape(FILTER_SEPARATOR),

'arg_sep': re.escape(FILTER_ARGUMENT_SEPARATOR),

filter_re = _lazy_re_compile(filter_raw_string, re.VERBOSE)

class FilterExpression:

"""

Parse a variable token and its optional filters (all as a single

string), and return a list of tuples of the filter name and arguments.

Sample::

>>> token = 'variable|default:"Default value"|date:"Y-m-d"'

>>> p = Parser('')

>>> fe = FilterExpression(token, p)

>>> len(fe.filters)

>>> fe.var <Variable:

'variable'>

Page | 47
Parking Management System

"""

def _init_(self, token, parser):

self.token = token

matches = filter_re.finditer(token)

var_obj = None

filters = []

upto = 0

for match in matches:

start = match.start()

if upto != start:

raise TemplateSyntaxError("Could not parse some characters: "

"%s|%s|%s" %

(token[:upto], token[upto:start],

token[start:]))

if var_obj is None:

var, constant = match['var'], match['constant']

if constant:

try:

var_obj = Variable(constant).resolve({})

except VariableDoesNotExist:

var_obj = None

elif var is None:

raise TemplateSyntaxError("Could not find variable at "

"start of %s." % token)

else:

Page | 48
Parking Management System

var_obj = Variable(var)

else:

filter_name = match['filter_name']

args = []

constant_arg, var_arg = match['constant_arg'], match['var_arg']

if constant_arg:

args.append((False, Variable(constant_arg).resolve({})))

elif var_arg:

args.append((True, Variable(var_arg)))

filter_func = parser.find_filter(filter_name)

self.args_check(filter_name, filter_func, args)

filters.append((filter_func, args))

upto = match.end()

if upto != len(token):

raise TemplateSyntaxError("Could not parse the remainder: '%s' " "from

'%s'" % (token[upto:], token))

self.filters = filters

self.var = var_obj

def resolve(self, context, ignore_failures=False):

if isinstance(self.var, Variable):

try:

obj = self.var.resolve(context)

except VariableDoesNotExist:

Page | 49
Parking Management System

if ignore_failures:

obj = None

else:

string_if_invalid = context.template.engine.string_if_invalid if

string_if_invalid:

if '%s' in string_if_invalid:

return string_if_invalid % self.var

else:

return string_if_invalid

else:

obj = string_if_invalid

else:

obj = self.var

for func, args in self.filters:

arg_vals = []

for lookup, arg in args:

if not lookup:

arg_vals.append(mark_safe(arg))

else:

arg_vals.append(arg.resolve(context))

if getattr(func, 'expects_localtime', False):

obj = template_localtime(obj, context.use_tz)

if getattr(func, 'needs_autoescape', False):

new_obj = func(obj, autoescape=context.autoescape, *arg_vals)

else:

Page | 50
Parking Management System

new_obj = func(obj, *arg_vals)

if getattr(func, 'is_safe', False) and isinstance(obj, SafeData):

obj = mark_safe(new_obj)

else:

obj = new_obj

return obj

def args_check(name, func, provided):

provided = list(provided)

# First argument, filter input, is

implied. plen = len(provided) + 1

# Check to see if a decorator is providing the real

function. func = inspect.unwrap(func)

args, _, _, defaults, _, _, _ = inspect.getfullargspec(func)

alen = len(args)

dlen = len(defaults or [])

# Not enough OR Too many

if plen < (alen - dlen) or plen > alen:

raise TemplateSyntaxError("%s requires %d arguments, %d provided"

% (name, alen - dlen, plen))

return True

args_check = staticmethod(args_check)

Page | 51
Parking Management System

def _str_(self):

return self.token

class Variable:

"""

A template variable, resolvable against a given context. The variable

may be a hard-coded string (if it begins and ends with single or double

quote marks)::

>>> c = {'article': {'section':'News'}}

>>> Variable('article.section').resolve(c)

'News'

>>> Variable('article').resolve(c)

{'section': 'News'}

>>> class AClass: pass

>>> c = AClass()

>>> c.article = AClass()

>>> c.article.section = 'News'

(The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')

"""

def _init_(self, var):

self.var = var

Page | 52
Parking Management System

self.literal = None

self.lookups = None

self.translate = False

self.message_context = None

if not isinstance(var, str):

raise TypeError(

"Variable must be a string or number, got %s" % type(var))

try:

# First try to treat this variable as a number.

# Note that this could cause an OverflowError here that we're not

# catching. Since this should only happen at compile time, that's

# probably OK.

# Try to interpret values containing a period or an 'e'/'E'

# (possibly scientific notation) as a float; otherwise, try int.

if '.' in var or 'e' in var.lower():

self.literal = float(var)

# "2." is invalid

if var.endswith('.'):

raise ValueError

else:

self.literal = int(var)

except ValueError:

Page | 53
Parking Management System

# A ValueError means that the variable isn't a

number. if var.startswith('_(') and var.endswith(')'):

# The result of the lookup should be translated at rendering

# time.

self.translate = True

var = var[2:-1]

# If it's wrapped with quotes (single or double), then

# we're also dealing with a literal.

try:

self.literal = mark_safe(unescape_string_literal(var))

except ValueError:

# Otherwise we'll set self.lookups so that resolve() knows we're

# dealing with a bonafide variable

if var.find(VARIABLE_ATTRIBUTE_SEPARATOR + '') > -1 or var[0] == '':

raise TemplateSyntaxError("Variables and attributes may "

"not begin with underscores: '%s'" %

var)

self.lookups = tuple(var.split(VARIABLE_ATTRIBUTE_SEPARATOR))

def resolve(self, context):

"""Resolve this variable against a given context."""

if self.lookups is not None:

# We're dealing with a variable that needs to be resolved

value = self._resolve_lookup(context)

else:

Page | 54
Parking Management System

# We're dealing with a literal, so it's already been "resolved"

value = self.literal

if self.translate:

is_safe = isinstance(value, SafeData)

msgid = value.replace('%', '%%')

msgid = mark_safe(msgid) if is_safe else msgid

if self.message_context:

return pgettext_lazy(self.message_context, msgid)

else:

return gettext_lazy(msgid)

return value

def _repr_(self):

return "<%s: %r>" % (self._class.name_, self.var)

def _str_(self):

return self.var

def _resolve_lookup(self, context):

"""

Perform resolution of a real variable (i.e. not a literal) against

the given context.

As indicated by the method's name, this method is an implementation

detail and shouldn't be called by external code. Use Variable.resolve()

Page | 55
Parking Management System

instead.

"""

current = context

try: # catch-all for silent variable failures

for bit in self.lookups:

try: # dictionary lookup

current = current[bit]

# ValueError/IndexError are for numpy.array lookup on

# numpy < 1.9 and 1.9+ respectively

except (TypeError, AttributeError, KeyError, ValueError, IndexError):

try: # attribute lookup

# Don't return class attributes if the class is the context:

if isinstance(current, BaseContext) and getattr(type(current), bit):

raise AttributeError

current = getattr(current, bit)

except (TypeError, AttributeError):

# Reraise if the exception was raised by a @property

if not isinstance(current, BaseContext) and bit in dir(current):

raise

try: # list-index lookup

current = current[int(bit)]

except (IndexError, # list index out of range

ValueError, # invalid literal for int()

KeyError, # current is a dict without `int(bit)` key

TypeError): # unsubscriptable object

Page | 56
Parking Management System

raise VariableDoesNotExist("Failed lookup for key "

"[%s] in %r",

(bit, current)) # missing attribute

if callable(current):

if getattr(current, 'do_not_call_in_templates', False):

pass

elif getattr(current, 'alters_data', False):

current =

context.template.engine.string_if_invalid else:

try: # method call (assuming no args required)

current = current()

except TypeError:

signature = inspect.signature(current)

try:

signature.bind()

except TypeError: # arguments were required

current = context.template.engine.string_if_invalid # invalid


method call

else:

raise

except Exception as e:

template_name = getattr(context, 'template_name', None) or

'unknown' logger.debug(

"Exception while resolving variable '%s' in template

'%s'.", bit,

Page | 57
Parking Management System

template_name,

exc_info=True,

if getattr(e, 'silent_variable_failure', False):

current = context.template.engine.string_if_invalid

else:

raise

return current

class Node:

# Set this to True for nodes that must be first in the template (although

# they can be preceded by text nodes.

must_be_first = False

child_nodelists = ('nodelist',)

token = None

def render(self, context):

"""

Return the node rendered as a string.

"""

pass

Page | 58
Parking Management System

def render_annotated(self, context):

"""

Render the node. If debug is True and an exception occurs during

rendering, the exception is annotated with contextual line

information where it occurred in the template. For internal usage this

method is preferred over using the render method directly. """

try:

return self.render(context)

except Exception as e:

if context.template.engine.debug and not hasattr(e, 'template_debug'):

e.template_debug =
context.render_context.template.get_exception_info(e, self.token)

raise

def _iter_(self):

yield self

def get_nodes_by_type(self, nodetype):

"""

Return a list of all nodes (within this node and its nodelist)

of the given type

"""

nodes = []

if isinstance(self, nodetype):

Page | 59
Parking Management System

nodes.append(self)

for attr in self.child_nodelists:

nodelist = getattr(self, attr, None)

if nodelist:

nodes.extend(nodelist.get_nodes_by_type(nodetype))

return nodes

class NodeList(list):

# Set to True the first time a non-TextNode is inserted by

# extend_nodelist().

contains_nontext = False

def render(self, context):

bits = []

for node in self:

if isinstance(node, Node):

bit = node.render_annotated(context)

else:

bit = node

bits.append(str(bit))

return mark_safe(''.join(bits))

def get_nodes_by_type(self, nodetype):

"Return a list of all nodes of the given type"

Page | 60
Parking Management System

nodes = []

for node in self:

nodes.extend(node.get_nodes_by_type(nodetype))

return nodes

class TextNode(Node):

def _init_(self, s):

self.s = s

def _repr_(self):

return "<%s: %r>" % (self._class.name_, self.s[:25])

def render(self, context):

return self.s

def render_value_in_context(value, context):

"""

Convert any value to a string to become part of a rendered template. This

means escaping, if required, and conversion to a string. If value is a

string, it's expected to already be translated. """

value = template_localtime(value, use_tz=context.use_tz)

value = localize(value, use_l10n=context.use_l10n)

Page | 61
Parking Management System

if context.autoescape:

if not issubclass(type(value), str):

value = str(value)

return conditional_escape(value)

else:

return str(value)

class VariableNode(Node):

def _init_(self, filter_expression):

self.filter_expression = filter_expression

def _repr_(self):

return "<Variable Node: %s>" % self.filter_expression

def render(self, context):

try:

output = self.filter_expression.resolve(context)

except UnicodeDecodeError:

# Unicode conversion can fail sometimes for reasons out of our

# control (e.g. exception rendering). In that case, we fail

# quietly.

return ''

return render_value_in_context(output, context)

Page | 62
Parking Management System

# Regex for token keyword arguments

kwarg_re = _lazy_re_compile(r"(?:(\w+)=)?(.+)")

def token_kwargs(bits, parser, support_legacy=False):

"""

Parse token keyword arguments and return a dictionary of the arguments

retrieved from the ``bits`` token list.

`bits` is a list containing the remainder of the token (split by spaces)

that is to be checked for arguments. Valid arguments are removed from this

list.

`support_legacy` - if True, the legacy format ``1 as foo`` is accepted.

Otherwise, only the standard ``foo=1`` format is allowed.

There is no requirement for all remaining token ``bits`` to be keyword

arguments, so return the dictionary as soon as an invalid argument format

is reached.

"""

if not bits:

return {}

match = kwarg_re.match(bits[0])

kwarg_format = match and match[1]

Page | 63
Parking Management System

if not kwarg_format:

if not support_legacy:

return {}

if len(bits) < 3 or bits[1] != 'as':

return {}

kwargs = {}

while bits:

if kwarg_format:

match = kwarg_re.match(bits[0])

if not match or not match[1]:

return kwargs

key, value = match.groups()

del bits[:1]

else:

if len(bits) < 3 or bits[1] != 'as':

return kwargs

key, value = bits[2], bits[0]

del bits[:3]

kwargs[key] = parser.compile_filter(value)

if bits and not kwarg_format:

if bits[0] != 'and':

return kwargs

del bits[:1]

return kwargs

Page | 64
Parking Management System

CHAPTER 6: RESULT DISCUSSION

Page | 65
Parking Management System

CHAPTER 6: RESULT AND DISCUSSION

Page | 66
Parking Management System

Page | 67
Parking Management System

Page | 68
Parking Management System

Page | 69
Parking Management System

Page | 70
Parking Management System

Page | 71
Parking Management System

CHAPTER 7: COCLUSION

Page | 72
Parking Management System

CHAPTER 7: COCLUSION

This Project is minimizing the task of parking a vehicle by paying and saying
some details about customer and vehicle to save data .In this the vehicle is parked
as a safe and secure. This project is done as Efficient as possible Hereby I, the
Student of BSc(IT) 6
th
Semester concludes that the project was completely and slowly developed
by me. I also conclude that this project has helped us gain more
knowledge about the topic that we are indulged ourselves into “
Visual Studio ”. I would
be glad to enhance and promote this project if given chance and help ourselves
and society in the near future The developed application is tested with sample
inputs and outputs obtained in according to the requirement. Even though I
have tried our level best to make it a dream project. Due to time constraints I
could not add more facilities to it. The efficiency of the developed system can
be enhanced with some minor modifications. Future development can be made
in proposed system by integration more services like:

It can be implemented through web pages.

New effectives modules can be added time to time

Page | 73
Parking Management System

Page | 74

You might also like